Skip to content

Commit ceacfde

Browse files
committed
dasharo-security: measured-boot: use 'Should Contain' with hashes
In case 'Execute Command In Terminal' returns additional lines e.g. kernel messages. Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
1 parent a9f1281 commit ceacfde

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

dasharo-security/measured-boot.robot

+11-11
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ MBO003.001 Changing Secure Boot certificate changes only PCR-7
7272
${pcr} ${hash}= Split String ${pcr_hash} separator=:
7373
${new_hash}= Execute Command In Terminal cat ${pcr}
7474
IF '/7' in '${pcr}'
75-
Should Not Be Equal ${hash} ${new_hash}
75+
Should Not Contain ${new_hash} ${hash}
7676
ELSE
77-
Should Be Equal ${hash} ${new_hash}
77+
Should Contain ${new_hash} ${hash}
7878
END
7979
END
8080

@@ -101,9 +101,9 @@ MBO004.001 Changing Dasharo network boot settings changes only PCR-1
101101
${pcr} ${hash}= Split String ${pcr_hash} separator=:
102102
${new_hash}= Execute Command In Terminal cat ${pcr}
103103
IF ${{'${pcr}'.endswith('/1')}}
104-
Should Not Be Equal ${hash} ${new_hash}
104+
Should Not Contain ${new_hash} ${hash}
105105
ELSE
106-
Should Be Equal ${hash} ${new_hash}
106+
Should Contain ${new_hash} ${hash}
107107
END
108108
END
109109

@@ -130,9 +130,9 @@ MBO004.002 Changing Dasharo security settings changes only PCR-1
130130
${pcr} ${hash}= Split String ${pcr_hash} separator=:
131131
${new_hash}= Execute Command In Terminal cat ${pcr}
132132
IF ${{'${pcr}'.endswith('/1')}}
133-
Should Not Be Equal ${hash} ${new_hash}
133+
Should Not Contain ${new_hash} ${hash}
134134
ELSE
135-
Should Be Equal ${hash} ${new_hash}
135+
Should Contain ${new_hash} ${hash}
136136
END
137137
END
138138

@@ -158,9 +158,9 @@ MBO004.003 Changing Dasharo APU settings changes only PCR-1
158158
${pcr} ${hash}= Split String ${pcr_hash} separator=:
159159
${new_hash}= Execute Command In Terminal cat ${pcr}
160160
IF ${{'${pcr}'.endswith('/1')}}
161-
Should Not Be Equal ${hash} ${new_hash}
161+
Should Not Contain ${new_hash} ${hash}
162162
ELSE
163-
Should Be Equal ${hash} ${new_hash}
163+
Should Contain ${new_hash} ${hash}
164164
END
165165
END
166166

@@ -196,7 +196,7 @@ MBO005.002 Multiple reset to defaults results in identical measurements
196196
FOR ${pcr_hash} IN @{default_hashes}
197197
${pcr} ${hash}= Split String ${pcr_hash} separator=:
198198
${new_hash}= Execute Command In Terminal cat ${pcr}
199-
Should Be Equal ${hash} ${new_hash}
199+
Should Contain ${new_hash} ${hash}
200200
END
201201

202202
MBO006.001 Identical configuration results in identical measurements
@@ -231,7 +231,7 @@ MBO006.001 Identical configuration results in identical measurements
231231
FOR ${pcr_hash} IN @{default_hashes}
232232
${pcr} ${hash}= Split String ${pcr_hash} separator=:
233233
${new_hash}= Execute Command In Terminal cat ${pcr}
234-
Should Be Equal ${hash} ${new_hash}
234+
Should Contain ${new_hash} ${hash}
235235
END
236236

237237
MBO006.002 Identical configuration after reset results in identical measurements
@@ -265,7 +265,7 @@ MBO006.002 Identical configuration after reset results in identical measurements
265265
FOR ${pcr_hash} IN @{default_hashes}
266266
${pcr} ${hash}= Split String ${pcr_hash} separator=:
267267
${new_hash}= Execute Command In Terminal cat ${pcr}
268-
Should Be Equal ${hash} ${new_hash}
268+
Should Contain ${new_hash} ${hash}
269269
END
270270

271271

0 commit comments

Comments
 (0)