Skip to content

Commit

Permalink
[guest-test] [tdx-guest] Test Enhance: handle rpm file error issue
Browse files Browse the repository at this point in the history
enhance test logic to handle non-accessible rpm file, due to
miss-config, file missing and etc.

[Test Components] tdx-guest
[Test Types] func
[Supported Devices] spr,emr,gnr,srf

Signed-off-by: Hongyu Ning <[email protected]>
  • Loading branch information
hongyuni authored and ysun committed Mar 6, 2024
1 parent 88f1662 commit 7e940a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tdx-guest/tdx.guest_test_executor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ case "$TESTCASE" in
if [[ "$GCOV" == "off" ]]; then
guest_test_close
fi
else
die "rpm file not accessible: $RPM"
fi
;;
TD_KDUMP_START)
Expand Down
5 changes: 5 additions & 0 deletions tdx-guest/tdx_rpm_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ RPM_FILE=$1

###################### Do Works ######################
# check rpm file type: kernel image, kernel devel or kernel headers
if [[ -f "$RPM_FILE" ]]; then
test_print_trc "rpm file for test: $RPM_FILE"
else
die "no rpm file for test"
fi

# for kernel-devel rpm, remove old devel package and install new one
if grep "\-devel\-" "$RPM_FILE" > /dev/null; then
Expand Down

0 comments on commit 7e940a9

Please sign in to comment.