示例#1
0
 def xtestCreate(self):
     r = run(r"nova volume-list")
     self.assertTrue(r,str(r))
     for l in r.output.split("\n")[3:-1]:
         if not "+" in l:
             i = volume(l)
             if i.Name == "testvolume1":
                 break
                 #print i
     else:
         r = run(r"nova volume-create --display_name testvolume1 5")
         if not r:
             print r.error
             self.assertTrue(None)
         time.sleep(3)
示例#2
0
 def xtestDelete(self):
     volume_id = 0
     r = run(r"nova volume-list")
     if not r:
         raise r
     else:
         for l in r.output.split("\n")[3:-1]:
             if not "+" in l:
                 i = volume(l)
                 if i.Name == "testvolume1":
                     volume_id = i.ID
                     break
     
     if volume_id:
         r = run(r"nova volume-delete {0}".format(volume_id))
         if not r:
             raise r
     else:
         self.assertTrue(None)
     time.sleep(30)