Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test for CA with request notification #4670

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading