2018-08-10 19:18:41 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
import mitogen
|
|
|
|
|
|
|
|
import unittest2
|
|
|
|
|
|
|
|
import testlib
|
|
|
|
|
|
|
|
|
2018-10-26 08:14:39 +00:00
|
|
|
class ConstructorTest(testlib.RouterMixin, unittest2.TestCase):
|
2018-08-10 19:18:41 +00:00
|
|
|
def test_okay(self):
|
2018-10-26 08:14:39 +00:00
|
|
|
lxc_path = testlib.data_path('stubs/lxc.py')
|
2018-08-10 19:18:41 +00:00
|
|
|
context = self.router.lxd(
|
|
|
|
container='container_name',
|
|
|
|
lxc_path=lxc_path,
|
|
|
|
)
|
|
|
|
|
|
|
|
argv = eval(context.call(os.getenv, 'ORIGINAL_ARGV'))
|
|
|
|
self.assertEquals(argv[0], lxc_path)
|
|
|
|
self.assertEquals(argv[1], 'exec')
|
2018-09-17 20:45:40 +00:00
|
|
|
self.assertEquals(argv[2], '--mode=noninteractive')
|
2018-08-10 19:18:41 +00:00
|
|
|
self.assertEquals(argv[3], 'container_name')
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest2.main()
|