From 5ec805f26bcd0d4871f69de3a10ddcef3655703b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Wed, 7 Apr 2021 08:45:11 +0000 Subject: [PATCH] fix: groupGenerateEgressKey: --help wasn't working properly --- bin/plugin/group-owner/groupGenerateEgressKey | 2 +- tests/functional/tests.d/350-groups.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/plugin/group-owner/groupGenerateEgressKey b/bin/plugin/group-owner/groupGenerateEgressKey index 72296f4..6e2c9c1 100755 --- a/bin/plugin/group-owner/groupGenerateEgressKey +++ b/bin/plugin/group-owner/groupGenerateEgressKey @@ -57,7 +57,7 @@ $fnret = OVH::Bastion::Plugin::generateEgressKey::preconditions( size => $size ); if ($fnret->err eq 'ERR_MISSING_PARAMETER') { - OVH::Bastion::Plugin::generateEgressKey::help(); + help(); osh_exit(R('ERR_MISSING_PARAMETER', msg => "Missing the 'algo', 'size' or 'group' parameter'")); } $fnret or osh_exit $fnret; diff --git a/tests/functional/tests.d/350-groups.sh b/tests/functional/tests.d/350-groups.sh index 5dcaaf9..00b8519 100644 --- a/tests/functional/tests.d/350-groups.sh +++ b/tests/functional/tests.d/350-groups.sh @@ -112,6 +112,9 @@ EOS retvalshouldbe 106 json .command null .error_code KO_RESTRICTED_COMMAND .value null + plgfail 350-groups a3_generate_key_help $a3 --osh groupGenerateEgressKey + json .command groupGenerateEgressKey .error_code ERR_MISSING_PARAMETER + plgfail 350-groups a3_generate_key_g1_fail $a3 --osh groupGenerateEgressKey --group $group1 --algo ed25519 json .command groupGenerateEgressKey .error_code ERR_NOT_GROUP_OWNER