From 114b6ffb09cf218c42fec366f834c4ac41d430dc Mon Sep 17 00:00:00 2001 From: Vincent Zurczak Date: Tue, 10 Dec 2024 18:34:49 +0100 Subject: [PATCH] #48 Resource Type Pattern does not match Ec2NodeClass --- lib/utils.bash | 4 ++-- tests/test.detik.verify.bats | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/utils.bash b/lib/utils.bash index b179bc7..110dd85 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -1,8 +1,8 @@ #!/bin/bash # The pattern for resource types -# (pod, PODs, complex.crd.resource, etc.) -resource_type_pattern="[a-z][a-z.]+" +# (pod, PODs, complex.crd.resource, ec2nodeclass, etc.) +resource_type_pattern="[a-z][0-9a-z.]+" # The regex for the "try" key word try_regex_verify_is="^at +most +([0-9]+) +times +every +([0-9]+)s +to +get +($resource_type_pattern) +named +'([^']+)' +and +verify +that +'([^']+)' +is +'([^']+)'$" diff --git a/tests/test.detik.verify.bats b/tests/test.detik.verify.bats index c467fa8..8aaab42 100755 --- a/tests/test.detik.verify.bats +++ b/tests/test.detik.verify.bats @@ -677,3 +677,12 @@ mytest_with_namespace() { [ "${lines[0]}" = "Valid expression. Verification in progress..." ] [ "${lines[1]}" = "Found 2 pods named nginx (instead of less than 1 expected)." ] } + + +@test "verifying the number of ec2nodeclass with the lower-case syntax (resource name with a number)" { + run verify "there are 2 ec2nodeclass named 'nginx'" + [ "$status" -eq 0 ] + [ ${#lines[@]} -eq 2 ] + [ "${lines[0]}" = "Valid expression. Verification in progress..." ] + [ "${lines[1]}" = "Found 2 ec2nodeclass named nginx (as expected)." ] +}