Skip to content

Commit

Permalink
CRAYSAT-1980: added failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanholen-hpe committed Feb 18, 2025
1 parent a04ee35 commit efa220d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# Define a configuration to use in image customization
configurations:

# A simple configuration that has just one layer that runs a simple failing playbook
- name: "{{test.prefix}}-simple-passing-configuration"
layers:
- name: successful-layer
playbook: test-fail.yml
git:
url: "https://api-gw-service-nmn.local/vcs/cray/{{csm.vcs_repo_name}}.git"
branch: "main"

images:
- name: "{{test.prefix}}-simple-customized-image"
base:
product:
name: csm
version: "{{csm.version}}"
type: image
filter:
arch: x86_64
wildcard: "*barebones*"
configuration: "{{test.prefix}}-simple-passing-configuration"
configuration_group_names:
- Compute

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ configurations:
- name: successful-layer
playbook: test.yml
git:
# The url does not currently support templating, so this doesn't work yet
url: "https://api-gw-service-nmn.local/vcs/cray/{{csm.vcs_repo_name}}.git"
branch: "main"

Expand Down
15 changes: 15 additions & 0 deletions src/csm_testing/tests/sat_functional/bootprep/test_bootprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,21 @@ def test_image_customization(self):
for image in report['images']:
self.items_to_delete['images'].append(image['final_image_id'])

@skip_test_if_csm_var_missing(["vcs_repo_name"])
def test_image_customization_fail(self):
"""Test creating an ims image with a configuration"""
result = self.run_bootprep('image-customization-fail.yaml', '--format json')

report = json.loads(result.stdout.decode())
self.assertEqual(1, len(report['configurations']))
self.assertEqual(1, len(report['images']))

for config in report['configurations']:
self.items_to_delete['configurations'].append(config['name'])

for image in report['images']:
self.items_to_delete['images'].append(image['final_image_id'])


if __name__ == '__main__':
unittest.main()

0 comments on commit efa220d

Please sign in to comment.