Skip to content

Commit 10e5a07

Browse files
committed
Add push model subtest to keylime_agent_container-basic-attestation
1 parent 14012ca commit 10e5a07

File tree

2 files changed

+26
-6
lines changed
  • container/functional/keylime_agent_container-basic-attestation

2 files changed

+26
-6
lines changed

container/functional/keylime_agent_container-basic-attestation/main.fmf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ recommend:
2323
- keylime
2424
duration: 10m
2525
enabled: true
26-
id: 3b782552-e418-4b35-86c3-d346cb8b0442
27-
extra-nitrate: TC#0615276
2826

2927
adjust:
3028
- when: swtpm != yes
3129
enabled: false
3230
because: We need to emulate multiple TPM devices with swtpm
31+
32+
/push:
33+
environment:
34+
AGENT_SERVICE: PushAgent
35+
/pull:
36+
environment:
37+
AGENT_SERVICE: Agent
38+
id: 3b782552-e418-4b35-86c3-d346cb8b0442

container/functional/keylime_agent_container-basic-attestation/test.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414

1515
[ -n "$REGISTRY" ] || REGISTRY=quay.io
1616

17+
TENANT_ARGS=""
18+
AGENT_CMD="keylime_agent"
19+
if [ "${AGENT_SERVICE}" == "PushAgent" ]; then
20+
TENANT_ARGS="--push-model"
21+
AGENT_CMD="keylime_push_model_agent"
22+
fi
23+
1724
rlJournalStart
1825

1926
rlPhaseStartSetup "Do the keylime setup"
@@ -35,6 +42,13 @@ rlJournalStart
3542
#verifier
3643
rlRun "limeUpdateConf verifier ip $SERVER_IP"
3744

45+
# configure push attestation
46+
if [ "${AGENT_SERVICE}" == "PushAgent" ]; then
47+
# Set the verifier to run in PUSH mode
48+
rlRun "limeUpdateConf verifier mode 'push'"
49+
rlRun "limeUpdateConf verifier challenge_lifetime 1800"
50+
fi
51+
3852
# start tpm emulator
3953
rlRun "limeStartTPMEmulator"
4054
rlRun "limeWaitForTPMEmulator"
@@ -82,7 +96,7 @@ rlJournalStart
8296
rlRun "limeconPrepareAgentConfdir $AGENT_ID_FIRST $IP_AGENT_FIRST confdir_$CONT_AGENT_FIRST"
8397

8498
#run of first agent
85-
rlRun "limeconRunAgent $CONT_AGENT_FIRST $TAG_AGENT $IP_AGENT_FIRST $CONT_NETWORK_NAME $TESTDIR_FIRST keylime_agent $PWD/confdir_$CONT_AGENT_FIRST $PWD/cv_ca"
99+
rlRun "limeconRunAgent $CONT_AGENT_FIRST $TAG_AGENT $IP_AGENT_FIRST $CONT_NETWORK_NAME $TESTDIR_FIRST $AGENT_CMD $PWD/confdir_$CONT_AGENT_FIRST $PWD/cv_ca"
86100
rlRun "limeWaitForAgentRegistration ${AGENT_ID_FIRST}"
87101

88102
#setup of second agent
@@ -92,7 +106,7 @@ rlJournalStart
92106
rlRun "limeconPrepareAgentConfdir $AGENT_ID_SECOND $IP_AGENT_SECOND confdir_$CONT_AGENT_SECOND"
93107

94108
#run of second agent
95-
rlRun "limeTPMDevNo=1 limeconRunAgent $CONT_AGENT_SECOND $TAG_AGENT $IP_AGENT_SECOND $CONT_NETWORK_NAME $TESTDIR_SECOND keylime_agent $PWD/confdir_$CONT_AGENT_SECOND $PWD/cv_ca"
109+
rlRun "limeTPMDevNo=1 limeconRunAgent $CONT_AGENT_SECOND $TAG_AGENT $IP_AGENT_SECOND $CONT_NETWORK_NAME $TESTDIR_SECOND $AGENT_CMD $PWD/confdir_$CONT_AGENT_SECOND $PWD/cv_ca"
96110
rlRun "limeWaitForAgentRegistration ${AGENT_ID_SECOND}"
97111

98112
# create allowlist and excludelist for each agent
@@ -103,12 +117,12 @@ rlJournalStart
103117
rlPhaseEnd
104118

105119
rlPhaseStartTest "Add keylime agents"
106-
rlRun -s "keylime_tenant -v $SERVER_IP -t $IP_AGENT_FIRST -u $AGENT_ID_FIRST --runtime-policy policy1.json -f /etc/hosts -c add"
120+
rlRun -s "keylime_tenant -v $SERVER_IP -t $IP_AGENT_FIRST -u $AGENT_ID_FIRST --runtime-policy policy1.json -f /etc/hosts -c add ${TENANT_ARGS}"
107121
rlRun "limeWaitForAgentStatus $AGENT_ID_FIRST 'Get Quote'"
108122
rlRun -s "keylime_tenant -c cvlist"
109123
rlAssertGrep "{'code': 200, 'status': 'Success', 'results': {'uuids':.*'$AGENT_ID_FIRST'" $rlRun_LOG -E
110124
#check second agent
111-
rlRun -s "keylime_tenant -v $SERVER_IP -t $IP_AGENT_SECOND -u $AGENT_ID_SECOND --runtime-policy policy2.json -f /etc/hosts -c add"
125+
rlRun -s "keylime_tenant -v $SERVER_IP -t $IP_AGENT_SECOND -u $AGENT_ID_SECOND --runtime-policy policy2.json -f /etc/hosts -c add ${TENANT_ARGS}"
112126
rlRun "limeWaitForAgentStatus $AGENT_ID_SECOND 'Get Quote'"
113127
rlPhaseEnd
114128

0 commit comments

Comments
 (0)