Ejemplo n.º 1
0
 def post(self):
     post_data = dict(urlparse.parse_qsl(self.request.body))
     result = CentOSVZAdapter.destroy_vm(post_data['vm_id'])
     self.write(result)
Ejemplo n.º 2
0
 def post(self):
     post_data = dict(urlparse.parse_qsl(self.request.body))
     result = CentOSVZAdapter.create_vm(json.loads(post_data['lab_spec']))
     self.write(result)
Ejemplo n.º 3
0
 def test_vm_creation(self):
     self.vm_id = self.adapter_instance.create_vm(self.lab_spec)
     self.ip_addr = CentOSVZAdapter.get_vm_ip(self.vm_id)
     self.m = re.match(r'[0-9]+.[0-9]+.([0-9]+).([0-9]+)', self.ip_addr)
     self.temp_vm_id = self.m.group(1) + self.m.group(2)
     self.assertEqual(self.temp_vm_id, self.vm_id)
Ejemplo n.º 4
0
 def test_copy_source(self):
     self.vm_id = self.adapter_instance.create_vm(self.lab_spec)
     CentOSVZAdapter.copy_ovpl_source(self.vm_id)
     CentOSVZAdapter.copy_lab_source(self.vm_id)
     ovpl_path = "/vz/root/" + self.vm_id + "/root/ovpl"
     assert (os.path.exists(ovpl_path) == True)
Ejemplo n.º 5
0
 def post(self):
     post_data = dict(urlparse.parse_qsl(self.request.body))
     result = CentOSVZAdapter.destroy_vm(post_data['vm_id'])
     self.write(result)
Ejemplo n.º 6
0
 def post(self):
     post_data = dict(urlparse.parse_qsl(self.request.body))
     result = CentOSVZAdapter.create_vm(json.loads(post_data['lab_spec']))
     self.write(result)