From: Joao Eduardo Luis Date: Mon, 20 Oct 2014 17:00:15 +0000 (+0100) Subject: qa/workunits: cephtool: don't remove self's key on auth tests X-Git-Tag: v0.87~16^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2758%2Fhead;p=ceph.git qa/workunits: cephtool: don't remove self's key on auth tests Suites run with CEPH_TEST_CLI_DUP_COMMAND=1, which will send a duplicate command for every command issued with the 'ceph' tool. Behavior is to get a reply from the command and then send a duplicate, looking for the same outcome (guaranteeing idempotency of the operations). However, it so happens that if you remove the entity's own key from the keyring and you happen to be unlucky enough so that the client's connection gets failed (we also run tests with connection failure injections), the 'ceph' tool won't be able to reconnect to the cluster to send the duplicate command (as it's entity no longer exists in the cluster's keyring). We rewrite the test instead of resorting to ugly hacks to work around this behavior, simply having a new 'role-definer' added by the existing 'role-definer' (which we weren't testing anyway, so bonus points for that) and then have one removing the other (to test the procedure) and finally using 'client.admin' to remove the last 'role-definer'. Fixes: #9820 Signed-off-by: Joao Eduardo Luis --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 8515c97dfbc3..fc02e301e553 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -344,8 +344,18 @@ function test_auth_profiles() ceph -n client.xx-profile-rd -k client.xx.keyring auth del client.xx-profile-ro ceph -n client.xx-profile-rd -k client.xx.keyring auth del client.xx-profile-rw - ceph -n client.xx-profile-rd -k client.xx.keyring auth del client.xx-profile-rd - rm -f client.xx.keyring + + # add a new role-definer with the existing role-definer + ceph -n client.xx-profile-rd -k client.xx.keyring \ + auth add client.xx-profile-rd2 mon 'allow profile role-definer' + ceph -n client.xx-profile-rd -k client.xx.keyring \ + auth export > client.xx.keyring.2 + # remove old role-definer using the new role-definer + ceph -n client.xx-profile-rd2 -k client.xx.keyring.2 \ + auth del client.xx-profile-rd + # remove the remaining role-definer with admin + ceph auth del client.xx-profile-rd2 + rm -f client.xx.keyring client.xx.keyring.2 } function test_mon_misc()