summaryrefslogtreecommitdiff
path: root/perl/t/data/keytab-fake
blob: 0ecf2644abc177f7ef7632efe4550ee1a936eec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
#
# keytab-fake -- Fake keytab-backend implementation.
#
# This keytab-fake script is meant to be run by remctld during testing of
# the keytab object implementation.  It returns a fixed string for
# wallet/one and returns an error for wallet/two.

set -e

if [ "$1" != "retrieve" ] ; then
    echo "Invalid command $1" >&2
    exit 1
fi

case "$2" in
wallet/one@*)
    printf 'Keytab for wallet/one'
    ;;
wallet/two@*)
    echo 'bite me' >&2
    exit 1
    ;;
*)
    echo "Unknown principal $2" >&2
    exit 1
    ;;
esac