The function get_dev_dir(self, match=None ) in euinstance.py not work.
Opened this issue · 0 comments
Hi:
when i do snapshot test, I found the get_dev_dir() can't get the devices. I add some code to print the return value of get_dev_dir(), I saw the return value are "[ ]". print "before attach", print before_attach, print "after attach", print after_attach are added by me. In log you can see there only print two "[ ]". so may be the function get_dev_dir(self, match=None ) is not work. thanks!
my source code:
def createVolume1(self,instance,size=2):
'''
Create a volume and attach it to an instance,crean a txt file in it
'''
assert(instance is not None)
self.volume1 = self.tester.create_volume(instance.placement, size)
device_path = "/dev/" + instance.block_device_prefix +"j"
before_attach = instance.get_dev_dir()
#this line is added by zhangjian for debug
print "before attach"
print before_attach
try:
assert(self.tester.attach_volume(instance, self.volume1, device_path,timeout=180)==True)
except AssertionError, e:
assert(self.__deleteVolume(self.volume1,timeout=180)==True)
self.volome1 = None
return False
after_attach = instance.get_dev_dir()
print "after attach"
print after_attach
new_devices = self.tester.diff(after_attach, before_attach)
if len(new_devices) is 0:
return False
self.volume_device1 = "/dev/" + new_devices[0].strip()
instance.assertFilePresent(self.volume_device1)
# create filesystem for volum1
instance.sys("mkfs -t ext2 " +self.volume_device1)
# create mnt dir
instance.sys("mkdir "+self.volume_mnt1)
# mount volume1
instance.sys("mount -t ext2 "+self.volume_device1 +" "+ self.volume_mnt1)
# create a file in the volume
instance.sys("touch "+self.volume_mnt1+"/"+self.testfilename)
instance.sys("echo HelloWorld! >" +self.volume_mnt1+"/"+self.testfilename)
# umount the volume
instance.sys("umount "+self.volume_device1)
# detach the volume
self.tester.detach_volume(self.volume1,timeout=180)
self.tester.sleep(5)
return True
my test log:
KEYWORD: ${BOOL_VAR} = snapshotbasic.Create Volume 1 ${INSTANCE} Expand All
Documentation:
Create a volume and attach it to an instance,crean a txt file in it
Start / End / Elapsed: 20121031 14:43:48.634 / 20121031 14:44:32.609 / 00:00:43.975
14:43:48.636 DEBUG Sending create volume request
14:43:48.637 DEBUG Method: POST
14:43:48.637 DEBUG Path: /services/Eucalyptus/
14:43:48.637 DEBUG Data:
14:43:48.637 DEBUG Headers: {}
14:43:48.637 DEBUG Host: eucalyptus.vaas126.cd.nsn-rdnet.net:8773
14:43:48.638 DEBUG Token: None
14:43:48.638 DEBUG using _calc_signature_2
14:43:48.639 DEBUG query string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=CreateVolume&AvailabilityZone=CC&SignatureMethod=HmacSHA256&SignatureVersion=2&Size=2&Timestamp=2012-10-31T06%3A43%3A48Z&Version=2009-11-30
14:43:48.639 DEBUG string_to_sign: POST
eucalyptus.vaas126.cd.nsn-rdnet.net:8773
/services/Eucalyptus/
AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=CreateVolume&AvailabilityZone=CC&SignatureMethod=HmacSHA256&SignatureVersion=2&Size=2&Timestamp=2012-10-31T06%3A43%3A48Z&Version=2009-11-30
14:43:48.639 DEBUG len(b64)=44
14:43:48.639 DEBUG base64 encoded digest: R0+FgAa8go2LD5qLQFbfYfhHSVel3nWlHIIlYZyAwf4=
14:43:48.640 DEBUG query_string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=CreateVolume&AvailabilityZone=CC&SignatureMethod=HmacSHA256&SignatureVersion=2&Size=2&Timestamp=2012-10-31T06%3A43%3A48Z&Version=2009-11-30 Signature: R0+FgAa8go2LD5qLQFbfYfhHSVel3nWlHIIlYZyAwf4=
14:43:48.920 DEBUG vol-EEC9417D2CCcreating2012-10-31T06:43:48.673Z
14:43:48.921 DEBUG Polling for volume to become available
14:43:48.922 DEBUG Volume (vol-EEC9417D) State(creating) sleeping 10s
14:43:58.927 DEBUG Method: POST
14:43:58.927 DEBUG Path: /services/Eucalyptus/
14:43:58.927 DEBUG Data:
14:43:58.927 DEBUG Headers: {}
14:43:58.941 DEBUG Host: eucalyptus.vaas126.cd.nsn-rdnet.net:8773
14:43:58.942 DEBUG Token: None
14:43:58.942 DEBUG using _calc_signature_2
14:43:58.942 DEBUG query string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A43%3A58Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:43:58.943 DEBUG string_to_sign: POST
eucalyptus.vaas126.cd.nsn-rdnet.net:8773
/services/Eucalyptus/
AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A43%3A58Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:43:58.943 DEBUG len(b64)=44
14:43:58.943 DEBUG base64 encoded digest: tcmLZGP0N9D2lNKpRJh2P9HjFzRgNJkhW6IQopvUMXE=
14:43:58.943 DEBUG query_string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A43%3A58Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D Signature: tcmLZGP0N9D2lNKpRJh2P9HjFzRgNJkhW6IQopvUMXE=
14:43:59.428 DEBUG vol-EEC9417D2CCcreating2012-10-31T06:43:48.673Z
14:43:59.429 DEBUG Volume:vol-EEC9417D in creating state
14:43:59.430 DEBUG Volume (vol-EEC9417D) State(creating) sleeping 10s
14:44:09.434 DEBUG Method: POST
14:44:09.434 DEBUG Path: /services/Eucalyptus/
14:44:09.435 DEBUG Data:
14:44:09.435 DEBUG Headers: {}
14:44:09.435 DEBUG Host: eucalyptus.vaas126.cd.nsn-rdnet.net:8773
14:44:09.435 DEBUG Token: None
14:44:09.435 DEBUG using _calc_signature_2
14:44:09.436 DEBUG query string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A09Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:09.436 DEBUG string_to_sign: POST
eucalyptus.vaas126.cd.nsn-rdnet.net:8773
/services/Eucalyptus/
AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A09Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:09.436 DEBUG len(b64)=44
14:44:09.437 DEBUG base64 encoded digest: Jdwph70PJ9iJdSaJiO5coOPo2Icwu/ZwJmHrPAx4kn0=
14:44:09.437 DEBUG query_string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A09Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D Signature: Jdwph70PJ9iJdSaJiO5coOPo2Icwu/ZwJmHrPAx4kn0=
14:44:09.912 DEBUG vol-EEC9417D2CCcreating2012-10-31T06:43:48.673Z
14:44:09.913 DEBUG Volume:vol-EEC9417D in creating state
14:44:09.914 DEBUG Volume (vol-EEC9417D) State(creating) sleeping 10s
14:44:19.924 DEBUG Method: POST
14:44:19.925 DEBUG Path: /services/Eucalyptus/
14:44:19.925 DEBUG Data:
14:44:19.925 DEBUG Headers: {}
14:44:19.925 DEBUG Host: eucalyptus.vaas126.cd.nsn-rdnet.net:8773
14:44:19.925 DEBUG Token: None
14:44:19.926 DEBUG using _calc_signature_2
14:44:19.926 DEBUG query string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A19Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:19.926 DEBUG string_to_sign: POST
eucalyptus.vaas126.cd.nsn-rdnet.net:8773
/services/Eucalyptus/
AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A19Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:19.926 DEBUG len(b64)=44
14:44:19.927 DEBUG base64 encoded digest: XdNQzt6S/I2pRneKItESl1j5I4TsmsF4d8pGj+lBzGE=
14:44:19.927 DEBUG query_string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A19Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D Signature: XdNQzt6S/I2pRneKItESl1j5I4TsmsF4d8pGj+lBzGE=
14:44:20.409 DEBUG vol-EEC9417D2CCavailable2012-10-31T06:43:48.673Z
14:44:20.410 DEBUG Volume:vol-EEC9417D in available state
14:44:20.411 DEBUG Done. Waited a total of 31 seconds
14:44:20.411 DEBUG [root@euca-10-68-122-14.eucalyptus.vaas126.cd.nsn-rdnet.net]# ls -1 /dev/ | grep '^sd'
14:44:20.412 DEBUG [chan 3] Max packet in: 34816 bytes
14:44:20.468 DEBUG done with exec
14:44:20.469 DEBUG
14:44:20.469 DEBUG Sending attach for Volume:vol-EEC9417D to be attached to Instance:i-DD714141 at requested device /dev/sdj
14:44:20.469 DEBUG Method: POST
14:44:20.469 DEBUG Path: /services/Eucalyptus/
14:44:20.470 DEBUG Data:
14:44:20.470 DEBUG Headers: {}
14:44:20.470 DEBUG Host: eucalyptus.vaas126.cd.nsn-rdnet.net:8773
14:44:20.470 DEBUG Token: None
14:44:20.470 DEBUG using _calc_signature_2
14:44:20.471 DEBUG query string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=AttachVolume&Device=%2Fdev%2Fsdj&InstanceId=i-DD714141&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A20Z&Version=2009-11-30&VolumeId=vol-EEC9417D
14:44:20.471 DEBUG string_to_sign: POST
eucalyptus.vaas126.cd.nsn-rdnet.net:8773
/services/Eucalyptus/
AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=AttachVolume&Device=%2Fdev%2Fsdj&InstanceId=i-DD714141&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A20Z&Version=2009-11-30&VolumeId=vol-EEC9417D
14:44:20.471 DEBUG len(b64)=44
14:44:20.471 DEBUG base64 encoded digest: jYsaOZWawS0Rqtx8Jbt3AyqNpas8W3061p7gOMIOl2M=
14:44:20.472 DEBUG query_string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=AttachVolume&Device=%2Fdev%2Fsdj&InstanceId=i-DD714141&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A20Z&Version=2009-11-30&VolumeId=vol-EEC9417D Signature: jYsaOZWawS0Rqtx8Jbt3AyqNpas8W3061p7gOMIOl2M=
14:44:21.114 DEBUG vol-EEC9417Di-DD714141/dev/sdjattaching2012-10-31T06:44:21.060Z
14:44:21.115 DEBUG Method: POST
14:44:21.115 DEBUG Path: /services/Eucalyptus/
14:44:21.116 DEBUG Data:
14:44:21.116 DEBUG Headers: {}
14:44:21.116 DEBUG Host: eucalyptus.vaas126.cd.nsn-rdnet.net:8773
14:44:21.116 DEBUG Token: None
14:44:21.116 DEBUG using _calc_signature_2
14:44:21.117 DEBUG query string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A21Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:21.117 DEBUG string_to_sign: POST
eucalyptus.vaas126.cd.nsn-rdnet.net:8773
/services/Eucalyptus/
AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A21Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:21.117 DEBUG len(b64)=44
14:44:21.117 DEBUG base64 encoded digest: dfQ1jG4u6fsQuhg7E5ERcwLVLNvBKthiLbrjAS+Ao/Q=
14:44:21.118 DEBUG query_string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A21Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D Signature: dfQ1jG4u6fsQuhg7E5ERcwLVLNvBKthiLbrjAS+Ao/Q=
14:44:21.581 DEBUG vol-EEC9417D2CCin-use2012-10-31T06:43:48.673Zvol-EEC9417Di-DD714141/dev/sdjattaching2012-10-31T06:44:21.073Z
14:44:21.582 DEBUG Method: POST
14:44:21.582 DEBUG Path: /services/Eucalyptus/
14:44:21.582 DEBUG Data:
14:44:21.582 DEBUG Headers: {}
14:44:21.583 DEBUG Host: eucalyptus.vaas126.cd.nsn-rdnet.net:8773
14:44:21.583 DEBUG Token: None
14:44:21.583 DEBUG using _calc_signature_2
14:44:21.583 DEBUG query string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A21Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:21.584 DEBUG string_to_sign: POST
eucalyptus.vaas126.cd.nsn-rdnet.net:8773
/services/Eucalyptus/
AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A21Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:21.584 DEBUG len(b64)=44
14:44:21.584 DEBUG base64 encoded digest: dfQ1jG4u6fsQuhg7E5ERcwLVLNvBKthiLbrjAS+Ao/Q=
14:44:21.584 DEBUG query_string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A21Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D Signature: dfQ1jG4u6fsQuhg7E5ERcwLVLNvBKthiLbrjAS+Ao/Q=
14:44:22.019 DEBUG vol-EEC9417D2CCin-use2012-10-31T06:43:48.673Zvol-EEC9417Di-DD714141/dev/sdjattaching2012-10-31T06:44:21.073Z
14:44:22.020 DEBUG Volume:vol-EEC9417D not 'attached', attach_data.status=attaching
14:44:22.021 DEBUG Volume:vol-EEC9417D state:in-use pause:10 elapsed:0
14:44:22.021 DEBUG Sleeping for 10 seconds
14:44:32.031 DEBUG Method: POST
14:44:32.032 DEBUG Path: /services/Eucalyptus/
14:44:32.032 DEBUG Data:
14:44:32.032 DEBUG Headers: {}
14:44:32.032 DEBUG Host: eucalyptus.vaas126.cd.nsn-rdnet.net:8773
14:44:32.033 DEBUG Token: None
14:44:32.033 DEBUG using _calc_signature_2
14:44:32.033 DEBUG query string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A32Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:32.034 DEBUG string_to_sign: POST
eucalyptus.vaas126.cd.nsn-rdnet.net:8773
/services/Eucalyptus/
AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A32Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D
14:44:32.034 DEBUG len(b64)=44
14:44:32.034 DEBUG base64 encoded digest: Zl5O9R/GTOL/ukPGEF4G5l0b8GBmP80r/WXN/+TEF1g=
14:44:32.046 DEBUG query_string: AWSAccessKeyId=UHEN1S3YAIF3ZIXMQYGGX&Action=DescribeVolumes&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-10-31T06%3A44%3A32Z&Version=2009-11-30&VolumeId.1=vol-EEC9417D Signature: Zl5O9R/GTOL/ukPGEF4G5l0b8GBmP80r/WXN/+TEF1g=
14:44:32.550 DEBUG vol-EEC9417D2CCin-use2012-10-31T06:43:48.673Zvol-EEC9417Di-DD714141/dev/sdjattached2012-10-31T06:44:21.073Z
14:44:32.551 DEBUG Volume:vol-EEC9417D, Attached: in-use - attached, elapsed:10
14:44:32.551 DEBUG [root@euca-10-68-122-14.eucalyptus.vaas126.cd.nsn-rdnet.net]# ls -1 /dev/ | grep '^sd'
14:44:32.552 DEBUG [chan 4] Max packet in: 34816 bytes
14:44:32.608 DEBUG done with exec
14:44:32.608 DEBUG
14:44:32.608 INFO before attach
[]
after attach
[]
14:44:32.609 INFO ${BOOL_VAR} = False