]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test: Add a test for authenticating with an empty authorization identity
authorSimon McVittie <smcv@collabora.com>
Fri, 12 Jan 2018 16:50:20 +0000 (16:50 +0000)
committerSimon McVittie <smcv@collabora.com>
Mon, 15 Jan 2018 14:05:21 +0000 (14:05 +0000)
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104588

test/Makefile.am
test/data/auth/external-auto.auth-script [new file with mode: 0644]

index feb84a65bb7b5104f8432ce1e1ea866c08d5e846..e40088ffa918580676471f93c9421702aebc9bfe 100644 (file)
@@ -472,6 +472,7 @@ static_data = \
        data/auth/anonymous-server-successful.auth-script \
        data/auth/cancel.auth-script \
        data/auth/client-out-of-mechanisms.auth-script \
+       data/auth/external-auto.auth-script \
        data/auth/external-failed.auth-script \
        data/auth/external-root.auth-script \
        data/auth/external-silly.auth-script \
diff --git a/test/data/auth/external-auto.auth-script b/test/data/auth/external-auto.auth-script
new file mode 100644 (file)
index 0000000..ddef4e1
--- /dev/null
@@ -0,0 +1,18 @@
+# Test that we can authenticate with an empty authorization identity
+SERVER
+EXPECT_HAVE_NO_CREDENTIALS
+
+# C: "I want to use EXTERNAL, I decline to specify an initial response"
+SEND 'AUTH EXTERNAL'
+# S: "OK, who do you claim to be?"
+EXPECT_COMMAND DATA
+EXPECT_STATE WAITING_FOR_INPUT
+EXPECT_HAVE_NO_CREDENTIALS
+# C: "I am whoever the kernel says I am"
+SEND 'DATA'
+# S: "I suppose I can't argue with that"
+EXPECT_COMMAND OK
+EXPECT_STATE WAITING_FOR_INPUT
+SEND 'BEGIN'
+EXPECT_STATE AUTHENTICATED
+EXPECT_HAVE_SOME_CREDENTIALS