Exemplo n.º 1
0
 def do_command(self):
     compat.setup()
     cnt = factory.make_container(self.app.pargs.envvars,
                                  self.app.pargs.port,
                                  self.app.pargs.allow_insecure_ssl)
     cnt.validate()
     cnt.start()
Exemplo n.º 2
0
    def test_container_generic(
        self,
        containerops_mock,
        _determine_platform_mock,
        make_container_fs_handler_mock,
    ):
        containerops_mock.is_multi.return_value = False
        containerops_mock.is_generic.return_value = True
        containerops_mock.is_preconfigured.return_value = False
        make_container_fs_handler_mock.return_value = dummy.CONTAINER_FS_HANDLER
        _determine_platform_mock.return_value = dummy.SOLN_STK

        generic_container = factory.make_container(
            envvars_str='a=b,c=d',
            pathconfig=dummy.PATH_CONFIG,
            host_port=dummy.HOST_PORT)

        self.assertIsInstance(generic_container, GenericContainer)
        self.assertEqual(dummy.CONTAINER_FS_HANDLER,
                         generic_container.fs_handler)
        self.assertEqual(dummy.SOLN_STK, generic_container.soln_stk)
        self.assertEqual(dummy.HOST_PORT, generic_container.host_port)
        self.assertDictEqual({
            'a': 'b',
            'c': 'd'
        },
                             generic_container.opt_env.filtered().map)
    def test_make_container_multi(self, containerops, _get_solution_stack,
                                  make_multicontainer_fs_handler):
        containerops.is_multi.return_value = True
        containerops.is_generic.return_value = False
        containerops.is_preconfigured.return_value = False
        make_multicontainer_fs_handler.return_value = dummy.MULTICONTAINER_FS_HANDLER
        _get_solution_stack.return_value = dummy.SOLN_STK

        multicontainer = factory.make_container(envvars_str='a=b,c=d',
                                                pathconfig=dummy.PATH_CONFIG)

        self.assertIsInstance(multicontainer, MultiContainer)
        self.assertEqual(dummy.MULTICONTAINER_FS_HANDLER,
                         multicontainer.fs_handler)
        self.assertEqual(dummy.SOLN_STK, multicontainer.soln_stk)
        self.assertDictEqual({
            'a': 'b',
            'c': 'd'
        },
                             multicontainer.opt_env.filtered().map)
Exemplo n.º 4
0
 def do_command(self):
     compat.setup()
     cnt = factory.make_container()
     cnt_viewmodel = ContainerViewModel.from_container(cnt)
     localops.print_container_details(cnt_viewmodel)
Exemplo n.º 5
0
 def do_command(self):
     compat.setup()
     cnt = factory.make_container()
     cnt_viewmodel = ContainerViewModel.from_container(cnt)
     localops.open_webpage(cnt_viewmodel)