Skip to content

Commit e9174b0

Browse files
authored
Fix bugs in OpenStack tests (#984)
* Fix bug: allow capi image w/recent Ubuntu * Fix bug: work around missing method in boto3 * Fix bug: ABORT result gets redacted Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
1 parent 2cfe674 commit e9174b0

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Tests/iaas/scs_0104_standard_images/standard_images.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
_specs = yaml.safe_load(r"""
1111
"ubuntu-capi-image-1":
1212
name_scheme: "ubuntu-capi-image v[0-9]\\.[0-9]+(\\.[0-9]+)?"
13-
source: https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube
13+
source:
14+
- https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2404-kube
15+
- https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube
1416
"ubuntu-capi-image-2":
1517
# this name_scheme uses `-` to separate base name "ubuntu-capi-image" from version
1618
# latest openstack-image-manager can be told to use `-` by setting `separator: "-"` on the image
1719
name_scheme: "ubuntu-capi-image-v[0-9]\\.[0-9]+(\\.[0-9]+)?"
18-
source: https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube
20+
source:
21+
- https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2404-kube
22+
- https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube
1923
"Ubuntu 24.04":
2024
source:
2125
- https://cloud-images.ubuntu.com/releases/noble/

Tests/iaas/scs_0123_mandatory_services/mandatory_services.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ def compute_scs_0123_swift_s3(conn: openstack.connection.Connection):
153153
finally:
154154
# Cleanup created S3 bucket
155155
if TESTCONTNAME in s3_buckets:
156-
s3.delete_bucket(Bucket=TESTCONTNAME)
156+
# contrary to Boto docs at
157+
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/delete_bucket.html
158+
# , the following fails with
159+
# AttributeError: 's3.ServiceResource' object has no attribute 'delete_bucket'. Did you mean: 'create_bucket'?
160+
# s3.delete_bucket(Bucket=TESTCONTNAME)
161+
# workaround:
162+
s3.Bucket(name=TESTCONTNAME).delete()
157163
# Clean up ec2 cred IF we created one
158164
remove_leftovers(usable_credentials, conn)

compliance-monitor/monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def _redact_report(report):
587587
return
588588
for invdata in report['run']['invocations'].values():
589589
stdout = invdata.get('stdout', [])
590-
redacted = [line for line in stdout if line[-4:] in ('PASS', 'FAIL')]
590+
redacted = [line for line in stdout if line.rsplit(': ', 1)[-1] in ('PASS', 'ABORT', 'FAIL')]
591591
if len(redacted) != len(stdout):
592592
redacted.insert(0, '(the following has been redacted)')
593593
invdata['stdout'] = redacted

0 commit comments

Comments
 (0)