mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-13 01:40:26 +00:00
Merge pull request #4541 from whowutwut/fix_based_on_UT
[OpenBMC] Fix argument parsing based on failure from UT cases
This commit is contained in:
@ -1180,7 +1180,10 @@ sub parse_args {
|
||||
}
|
||||
|
||||
if (scalar @flash_arguments > 1) {
|
||||
if ($filename_passed and $option_flag !~ /^-d$/) {
|
||||
if (($option_flag =~ /^-a$|^--activate$|^--delete$/) or ($filename_passed and $option_flag !~ /^-d$/)) {
|
||||
# Handles:
|
||||
# - Multiple options not supported to activate/delete at the same time
|
||||
# - Filename passed in and option is not -d for directory
|
||||
return ([1, "More than one firmware specified is not supported."]);
|
||||
} elsif ($option_flag =~ /^-d$/) {
|
||||
return ([1, "More than one directory specified is not supported."]);
|
||||
|
@ -14,14 +14,14 @@ os:Linux
|
||||
hcp:openbmc
|
||||
cmd: rflash $$CN -a /tmp/abc123.tz
|
||||
check:rc==1
|
||||
check:output=~Error: Invalid option
|
||||
check:output=~Error: Invalid firmware specified with -a
|
||||
end
|
||||
|
||||
start:rflash_invalid_activate_and_delete
|
||||
description: Cannot specify -a and -d at the same time
|
||||
description: Cannot specify -a and --delete at the same time
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd: rflash $$CN -a 123 -d 123
|
||||
cmd: rflash $$CN -a 123 --delete 123
|
||||
check:rc==1
|
||||
check:output=~Error: Multiple options are not supported
|
||||
end
|
||||
@ -66,7 +66,7 @@ start:rflash_invalid_delete_2
|
||||
description: Attempt to delete more than 1 ID from the FW
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd: rflash $$CN -d 221d9020 221d9020
|
||||
cmd: rflash $$CN --delete 221d9020 221d9020
|
||||
check:rc==1
|
||||
check:output=~Error: More than one firmware specified is not supported
|
||||
end
|
||||
|
Reference in New Issue
Block a user