Skip to content

Commit fb44b90

Browse files
committed
testflash_image_check.robot: region checks from list objects
test/common/keywords.robot: Download And Check Flash Image extended with region list as argument and improved command line concatenation. Signed-off-by: Mateusz Maciejewski <mateusz.maciejewski@3mdeb.com>
1 parent ce34264 commit fb44b90

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

osfv_cli/test/common/keywords.robot

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,29 +85,32 @@ Check In
8585
Download And Check Flash Image
8686
[Documentation] This keyword downloads Dasharo flash image and runs osfv_cli
8787
... with flash check command, eventually in dry mode with enforced success
88-
... command status.
89-
[Arguments] ${image_url} ${dry_mode}=${FALSE}
88+
... command status. Expected regions are passed with -c options added to
89+
... command line.
90+
[Arguments] ${image_url} ${dry_mode} @{regions}
9091
Remove Directory ${MECHECK_TMP_DIR} True
9192
Create Directory ${MECHECK_TMP_DIR}
93+
9294
${wget_output}= Run Process
9395
... wget
9496
... ${image_url}
9597
... -O
9698
... ${MECHECK_TMP_DIR}/coreboot.rom
9799
File Should Exist ${MECHECK_TMP_DIR}/coreboot.rom
100+
101+
${command}= Catenate
102+
... osfv_cli flash_image_check --rom ${MECHECK_TMP_DIR}/coreboot.rom
103+
104+
FOR ${region} IN @{regions}
105+
${command}= Catenate ${command} -c ${region}
106+
END
107+
98108
IF ${dry_mode} == ${TRUE}
99-
${cli_output}= Run Process
100-
... osfv_cli
101-
... flash_image_check
102-
... --rom
103-
... ${MECHECK_TMP_DIR}/coreboot.rom
104-
... -x
105-
ELSE
106-
${cli_output}= Run Process
107-
... osfv_cli
108-
... flash_image_check
109-
... --rom
110-
... ${MECHECK_TMP_DIR}/coreboot.rom
109+
${command}= Catenate ${command} -x
111110
END
111+
112+
${cli_output}= Run Process
113+
... ${command}
114+
... shell=True
112115
Remove Directory ${MECHECK_TMP_DIR} True
113116
RETURN ${cli_output}

osfv_cli/test/flash_image_check.robot

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,40 @@ ${EXPECTED_STDOUT_SUCCESS_STRING}= SUCCESS: region "me" is present and cont
1818
*** Test Cases ***
1919
Test Flash Check - No ME in image
2020
[Documentation] Check image containing descriptor but no ME region
21+
@{regions_to_check}= Create List me
2122
${cli_check_out}= Download And Check Flash Image
2223
... ${MECHECK_NO_ME_URL}
24+
... ${FALSE}
25+
... @{regions_to_check}
2326
Should Contain ${cli_check_out.stderr} ${EXPECTED_STDERR_FAILURE_STRING}
2427

2528
Test Flash Check - Complete image
2629
[Documentation] Check image containing descriptor and ME region
30+
@{regions_to_check}= Create List me
2731
${cli_check_out}= Download And Check Flash Image
2832
... ${MECHECK_ME_URL}
33+
... ${FALSE}
34+
... @{regions_to_check}
2935
Should Not Contain ${cli_check_out.stderr} flash_image_check failed.
3036
Should Contain ${cli_check_out.stdout} ${EXPECTED_STDOUT_SUCCESS_STRING}
3137

3238
Test Flash Check - No ME in image but DRY check
3339
[Documentation] Check image containing descriptor but no ME region
3440
... in dry mode.
41+
@{regions_to_check}= Create List me
3542
${cli_check_out}= Download And Check Flash Image
3643
... ${MECHECK_NO_ME_URL}
3744
... ${TRUE}
45+
... @{regions_to_check}
3846
Should Not Contain ${cli_check_out.stderr} ${EXPECTED_STDERR_FAILURE_STRING}
3947

4048
Test Flash Check - Complete image but DRY check
4149
[Documentation] Check image containing descriptor and ME region in
4250
... dry mode.
51+
@{regions_to_check}= Create List me
4352
${cli_check_out}= Download And Check Flash Image
4453
... ${MECHECK_ME_URL}
4554
... ${TRUE}
55+
... @{regions_to_check}
4656
Should Not Contain ${cli_check_out.stderr} ${EXPECTED_STDERR_FAILURE_STRING}
4757
Should Contain ${cli_check_out.stdout} ${EXPECTED_STDOUT_SUCCESS_STRING}

0 commit comments

Comments
 (0)