diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 8e439243b..f3ba1e480 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -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."]); diff --git a/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 index 760e651e5..83f596e8c 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 @@ -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