Skip to content

Commit

Permalink
Set keylime_port_t label for random ports use in tests
Browse files Browse the repository at this point in the history
Apply condtionally for specific version of rhel and fedoras.
  • Loading branch information
Koncpa authored Aug 14, 2023
1 parent a516866 commit bf755be
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ require:
- openssl
- nmap-ncat
- python3-toml
- policycoreutils-python-utils
recommend:
- keylime
duration: 15m
Expand Down
5 changes: 5 additions & 0 deletions functional/basic-attestation-with-custom-certificates/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ rlJournalStart
rlRun 'rlImport "certgen/certgen"' || rlDie "cannot import openssl/certgen library"
rlAssertRpm keylime

#seting keylime_port_t label for ssl port
if rlIsRHEL '>=9.3' || rlIsFedora '>=38' || rlIsCentOS '>=9';then
rlRun "semanage port -a -t keylime_port_t -p tcp $SSL_SERVER_PORT"
fi

# generate TLS certificates for all
# we are going to use 4 certificates
# verifier = webserver cert used for the verifier server
Expand Down
1 change: 1 addition & 0 deletions functional/keylime-non-default-ports/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require:
- yum
- tpm2-tools
- python3-toml
- policycoreutils-python-utils
recommend:
- keylime
duration: 5m
Expand Down
10 changes: 10 additions & 0 deletions functional/keylime-non-default-ports/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ rlJournalStart
rlRun "limeInstallIMAConfig"
rlRun "limeStartIMAEmulator"
fi

#seting keylime_port_t label for non default ports
if rlIsRHEL '>=9.3' || rlIsFedora '>=38' || rlIsCentOS '>=9';then
rlRun "semanage port -a -t keylime_port_t -p tcp 19002"
rlRun "semanage port -a -t keylime_port_t -p tcp 18890"
rlRun "semanage port -a -t keylime_port_t -p tcp 18992"
rlRun "semanage port -a -t keylime_port_t -p tcp 18891"
rlRun "semanage port -a -t keylime_port_t -p tcp 18881"
fi

sleep 5
#set non default ports
#default port 9002
Expand Down

0 comments on commit bf755be

Please sign in to comment.