Skip to content

Commit

Permalink
tests: Extend regex's with optional match for Attributes in profiles
Browse files Browse the repository at this point in the history
The default-v1 profile may soon also set Attributes in the JSON and
therefore extend the regular expressions matching profiles to optionally
match for Attributes.

Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed Oct 17, 2024
1 parent 1eb06b6 commit a72da2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_tpm2_swtpm_setup_profile
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ for profile in ${profiles}; do
"\"StateFormatLevel\":[0-9]+,"\
"\"Commands\":\"[,x[:xdigit:]-]+\","\
"\"Algorithms\":\"[,=[:alnum:]-]+\","\
"(\"Attributes\":\"[,=[:alnum:]-]+\",)?"\
"\"Description\":\"[[:print:]]+\""\
"\}\}\$"| tr -d " ")
test_swtpm_setup_profile \
Expand Down
1 change: 1 addition & 0 deletions tests/test_tpm2_swtpm_setup_profile_name
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ exp_response_default=$(echo "^\{\"ActiveProfile\":\{" \
"\"StateFormatLevel\":[0-9]+,"\
"\"Commands\":\"[,x[:xdigit:]-]+\","\
"\"Algorithms\":\"[,=[:alnum:]-]+\","\
"(\"Attributes\":\"[,=[:alnum:]-]+\",)?"\
"\"Description\":\"This${SP}profile${SP}enables${SP}all${SP}[[:print:]]+\""\
"\}\}\$"| tr -d " ")
test_swtpm_setup_profile "${workdir}" "builtin:default-v1" "${exp_response_default}" "0"
Expand Down

0 comments on commit a72da2d

Please sign in to comment.