Skip to contentSkip to conversation

master - tests: handle su login difference

PATCH Zdenek Kabelac 1 participant 1 message Jun 23, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d0c97b44016024676e9f1dd24a4db4a7182f9918
Commit:        d0c97b44016024676e9f1dd24a4db4a7182f9918
Parent:        cc03a872c09941f2dbd1c9d3f2d7e89070649d17
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Jun 23 15:11:26 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Jun 23 18:44:01 2017 +0200

tests: handle su login difference

Workaround case, where it matters if 'su' was user with '-' or without.

---
 test/shell/dmsetup-keyring.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
test/shell/dmsetup-keyring.sh +2 -1
index 127d2f7..e333a6e 100644
@@ -31,7 +31,8 @@ aux target_at_least dm-zero 1 0 0 || skip "missing dm-zero target"
 aux target_at_least dm-crypt 1 15 0 || skip "dm-crypt doesn't support keys in kernel keyring service"
 which keyctl || skip "test requires keyctl utility"
 
-keyctl newring $PREFIX-keyring @u
+keyctl new_session || true   # fails with 'su', works with 'su -'
+keyctl newring $PREFIX-keyring @s
 keyctl timeout %:$PREFIX-keyring 60
 
 trap '_teardown' EXIT