cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #05637
[Merge] ~chad.smith/cloud-init:bug/1797199-integration-test-fix-nocloud-subplatform into cloud-init:master
Chad Smith has proposed merging ~chad.smith/cloud-init:bug/1797199-integration-test-fix-nocloud-subplatform into cloud-init:master.
Commit message:
tests: fix kvm integration test to assert flexible config-disk path
Make integration test for flexible using regexp in case disk changes.
Also fix test summary output in verify to print traceback if test's
'error' is an empty string.
LP: #1797199
Requested reviews:
cloud-init commiters (cloud-init-dev)
For more details, see:
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/356425
--
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:bug/1797199-integration-test-fix-nocloud-subplatform into cloud-init:master.
diff --git a/tests/cloud_tests/testcases/base.py b/tests/cloud_tests/testcases/base.py
index 16b268e..e5d7712 100644
--- a/tests/cloud_tests/testcases/base.py
+++ b/tests/cloud_tests/testcases/base.py
@@ -262,7 +262,10 @@ class CloudTestCase(unittest2.TestCase):
self.assertItemsEqual([], instance_data['base64_encoded_keys'])
self.assertEqual('unknown', v1_data['cloud_name'])
self.assertEqual('nocloud', v1_data['platform'])
- self.assertEqual('config-disk (/dev/vda)', v1_data['subplatform'])
+ subplatform = v1_data['subplatform']
+ self.assertIsNotNone(
+ re.match(r'config-disk \(\/dev\/vd[a-z]\)', subplatform),
+ 'kvm subplatform "%s" != "config-disk (/dev/vd.)"' % subplatform)
self.assertIsNone(
v1_data['availability_zone'],
'found unexpected kvm availability_zone %s' %
diff --git a/tests/cloud_tests/verify.py b/tests/cloud_tests/verify.py
index 9911ecf..7018f4d 100644
--- a/tests/cloud_tests/verify.py
+++ b/tests/cloud_tests/verify.py
@@ -61,12 +61,17 @@ def format_test_failures(test_result):
if not test_result['failures']:
return ''
failure_hdr = ' test failures:'
- failure_fmt = ' * {module}.{class}.{function}\n {error}'
+ failure_fmt = ' * {module}.{class}.{function}\n '
output = []
for failure in test_result['failures']:
if not output:
output = [failure_hdr]
- output.append(failure_fmt.format(**failure))
+ msg = failure_fmt.format(**failure)
+ if failure.get('error'):
+ msg += failure['error']
+ else:
+ msg += failure.get('traceback', '')
+ output.append(msg)
return '\n'.join(output)
Follow ups