Script to test creation of a stack of volumes 2 voumes deep. """ from nova_volume_testing.util.novaexerciser import Volume, Instance, Snapshot if __name__ == "__main__": print "003 snapshot stack - create snapshots of volumes that were created "\ "from snapshots, check all volumes can be changed without "\ "corrupting other volumes" instance = Instance() volume = Volume(size=1) assert volume.attached() == False volume.attach(instance) assert volume.attached() == True assert volume.attached(instance) == True volume.write_test_pattern(key=1) assert volume.check_test_pattern(key=1) == True volume.detach() assert volume.attached() == False snapshot = Snapshot(volume) snapvol = Volume(snapshot=snapshot) snapvol.attach(instance) assert snapvol.check_test_pattern(key=1) == True snapvol.write_test_pattern(key=2) assert snapvol.check_test_pattern(key=2) == True volume.attach(instance) assert volume.check_test_pattern(key=1) == True volume.write_test_pattern(key=3) assert volume.check_test_pattern(key=3) == True
from nova_volume_testing.util.novaexerciser import Volume, Instance, Snapshot if __name__ == "__main__": print "002 basic snapshot - Create a volume, write to it, snapshot it, "\ "create a volume from the snapshot, change original, check "\ "snapshot, change snapshot, check original" instance = Instance() volume = Volume(size=1) assert volume.attached() == False volume.attach(instance) assert volume.attached() == True assert volume.attached(instance) == True volume.write_test_pattern(key=1) assert volume.check_test_pattern(key=1) == True volume.detach() assert volume.attached() == False snapshot = Snapshot(volume) snapvol = Volume(snapshot=snapshot) snapvol.attach(instance) assert snapvol.check_test_pattern(key=1) == True snapvol.write_test_pattern(key=2, percentage=10) assert snapvol.check_test_pattern(key=2, percentage=10) == True
if __name__ == "__main__": print "001 basic volume create attach - Create a volume, attach it to an "\ "instance, write to it, dettach it and attach it to a different"\ "instance, check the data" instance1 = Instance() instance2 = Instance() volume = Volume(size=1) assert volume.attached() == False volume.attach(instance1) assert volume.attached() == True assert volume.attached(instance1) == True volume.write_test_pattern() assert volume.check_test_pattern() == True assert volume.check_test_pattern(key=16) == False volume.detach() assert volume.attached() == False volume.attach(instance2) assert volume.attached(instance2) == True assert volume.check_test_pattern() == True volume.write_test_pattern(key=16) assert volume.check_test_pattern(key=16) == True volume.detach() assert volume.attached() == False
Script to test creation of a stack of volumes 2 voumes deep. """ from nova_volume_testing.util.novaexerciser import Volume, Instance, Snapshot if __name__ == "__main__": print "003 snapshot stack - create snapshots of volumes that were created "\ "from snapshots, check all volumes can be changed without "\ "corrupting other volumes" instance = Instance() volume = Volume(size=1) assert volume.attached() == False volume.attach(instance) assert volume.attached() == True assert volume.attached(instance) == True volume.write_test_pattern(key=1) assert volume.check_test_pattern(key=1) == True volume.detach() assert volume.attached() == False snapshot = Snapshot(volume) snapvol = Volume(snapshot=snapshot) snapvol.attach(instance) assert snapvol.check_test_pattern(key=1) == True snapvol.write_test_pattern(key=2) assert snapvol.check_test_pattern(key=2) == True volume.attach(instance) assert volume.check_test_pattern(key=1) == True volume.write_test_pattern(key=3) assert volume.check_test_pattern(key=3) == True
if __name__ == "__main__": print "001 basic volume create attach - Create a volume, attach it to an "\ "instance, write to it, dettach it and attach it to a different"\ "instance, check the data" instance1 = Instance() instance2 = Instance() volume = Volume(size=1) assert volume.attached() == False volume.attach(instance1) assert volume.attached() == True assert volume.attached(instance1) == True volume.write_test_pattern() assert volume.check_test_pattern() == True assert volume.check_test_pattern(key=16) == False volume.detach() assert volume.attached() == False volume.attach(instance2) assert volume.attached(instance2) == True assert volume.check_test_pattern() == True volume.write_test_pattern(key=16) assert volume.check_test_pattern(key=16) == True volume.detach() assert volume.attached() == False