Exemplo n.º 1
0
    def test_cache_image(self):
        self.mox.StubOutWithMock(os, 'makedirs')
        self.mox.StubOutWithMock(os.path, 'exists')
        os.makedirs(pxe.get_image_dir_path(self.instance)).\
                AndReturn(True)
        os.path.exists(pxe.get_image_file_path(self.instance)).\
                AndReturn(True)
        self.mox.ReplayAll()

        image_meta = utils.get_test_image_info(self.context, self.instance)
        self.driver._cache_image(self.context, self.instance, image_meta)
        self.mox.VerifyAll()
Exemplo n.º 2
0
    def test_cache_image(self):
        self.mox.StubOutWithMock(os, 'makedirs')
        self.mox.StubOutWithMock(os.path, 'exists')
        os.makedirs(pxe.get_image_dir_path(self.instance)).\
                AndReturn(True)
        os.path.exists(pxe.get_image_file_path(self.instance)).\
                AndReturn(True)
        self.mox.ReplayAll()

        image_meta = utils.get_test_image_info(
                self.context, self.instance)
        self.driver._cache_image(
                self.context, self.instance, image_meta)
        self.mox.VerifyAll()
Exemplo n.º 3
0
 def _create_node(self):
     self.node = db.bm_node_create(self.context, self.node_info)
     for nic in self.nic_info:
         db.bm_interface_create(
             self.context,
             self.node['id'],
             nic['address'],
             nic['datapath_id'],
             nic['port_no'],
         )
     self.instance['node'] = self.node['id']
     self.spawn_params = dict(
         admin_password='******',
         block_device_info=self.test_block_device_info,
         context=self.context,
         image_meta=utils.get_test_image_info(None, self.instance),
         injected_files=[('/fake/path', 'hello world')],
         instance=self.instance,
         network_info=self.test_network_info,
     )
Exemplo n.º 4
0
 def _create_node(self):
     self.node = db.bm_node_create(self.context, self.node_info)
     for nic in self.nic_info:
         db.bm_interface_create(
                                 self.context,
                                 self.node['id'],
                                 nic['address'],
                                 nic['datapath_id'],
                                 nic['port_no'],
             )
     self.instance['node'] = self.node['id']
     self.spawn_params = dict(
             admin_password='******',
             block_device_info=self.test_block_device_info,
             context=self.context,
             image_meta=utils.get_test_image_info(None,
                                                     self.instance),
             injected_files=[('/fake/path', 'hello world')],
             instance=self.instance,
             network_info=self.test_network_info,
         )