]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: unit tests for auid display 2731/head
authorLoic Dachary <loic-201408@dachary.org>
Wed, 15 Oct 2014 20:15:34 +0000 (13:15 -0700)
committerLoic Dachary <loic-201408@dachary.org>
Wed, 15 Oct 2014 20:25:17 +0000 (13:25 -0700)
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
qa/workunits/cephtool/test.sh

index 359856318838c1ccee15200cdcbad12ca75008cd..bc0b23a4597b5a8f51c2bd39e75298a22bfb15eb 100755 (executable)
@@ -105,7 +105,7 @@ function map_enxio_to_eagain()
 
 function check_response()
 {
-       expected_stderr_string=$1
+       expected_string=$1
        retcode=$2
        expected_retcode=$3
        if [ "$expected_retcode" -a $retcode != $expected_retcode ] ; then
@@ -113,9 +113,8 @@ function check_response()
                exit 1
        fi
 
-       if ! grep "$expected_stderr_string" $TMPFILE >/dev/null 2>&1 ; then 
-               echo "Didn't find $expected_stderr_string in stderr output" >&2
-               echo "Stderr: " >&2
+       if ! grep "$expected_string" $TMPFILE >/dev/null 2>&1 ; then 
+               echo "Didn't find $expected_string in output" >&2
                cat $TMPFILE >&2
                exit 1
        fi
@@ -360,6 +359,22 @@ function test_auth()
   diff authfile authfile2
   rm authfile authfile2
   ceph auth del client.xx
+  #
+  # get / set auid
+  #
+  local auid=444
+  ceph-authtool --create-keyring --name client.TEST --gen-key --set-uid $auid TEST-keyring
+  ceph auth import --in-file TEST-keyring
+  rm TEST-keyring
+  ceph auth get client.TEST > $TMPFILE
+  check_response "auid = $auid"
+  ceph --format json-pretty auth get client.TEST > $TMPFILE
+  check_response '"auid": '$auid
+  ceph auth list > $TMPFILE
+  check_response "auid: $auid"
+  ceph --format json-pretty auth list > $TMPFILE
+  check_response '"auid": '$auid
+  ceph auth del client.TEST
 }
 
 function test_auth_profiles()