Skip to content

Commit

Permalink
Fix test for CA with request notification
Browse files Browse the repository at this point in the history
In Fedora 40 the mailx package was replaced with the s-nail
package. The test for CA with request notification has been
updated to expect different messages depending on the package
actually installed.
  • Loading branch information
edewata committed Feb 16, 2024
1 parent 90a8d1a commit c25f71e
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions .github/workflows/ca-notification-request-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,27 @@ jobs:
run: |
sleep 60
MAILX_PROVIDER=$(docker exec pki rpm -q --whatprovides mailx)
echo "mailx provider: $MAILX_PROVIDER"
# check mailbox
echo -ne "q\n" | docker exec -i pki mail \
> >(tee stdout) 2> >(tee stderr >&2) || true
# there should be no messages
echo "No mail for root" > expected
if [[ "$MAILX_PROVIDER" =~ ^mailx- ]]; then
echo "No mail for root" > expected
elif [[ "$MAILX_PROVIDER" =~ ^s-nail- ]]; then
echo "s-nail: No mail for root at /var/mail/root" > expected
echo "s-nail: /var/mail/root: No such entry, file or directory" >> expected
else
echo "ERROR: Unknown mailx provider: $MAILX_PROVIDER"
exit 1
fi
diff expected stderr
- name: Submit enrollment request
Expand All @@ -111,15 +127,31 @@ jobs:
run: |
sleep 60
MAILX_PROVIDER=$(docker exec pki rpm -q --whatprovides mailx)
echo "mailx provider: $MAILX_PROVIDER"
# check mailbox
echo -ne "q\n" | docker exec -i pki mail \
> >(tee stdout) 2> >(tee stderr >&2) || true
# there should be 1 message
echo "Held 1 message in /var/mail/root" > expected
if [[ "$MAILX_PROVIDER" =~ ^mailx- ]]; then
echo "Held 1 message in /var/mail/root" > expected
elif [[ "$MAILX_PROVIDER" =~ ^s-nail- ]]; then
echo "Held 1 message in /var/spool/mail/root" > expected
else
echo "ERROR: Unknown mailx provider: $MAILX_PROVIDER"
exit 1
fi
tail -1 stdout > actual
diff expected actual
echo -ne "1\nq\n" | docker exec -i pki mail | tee output
# print first email
echo -ne "p\nq\n" | docker exec -i pki mail | tee output
# check email subject
REQUEST_ID=$(cat request.id)
Expand Down

0 comments on commit c25f71e

Please sign in to comment.