Debian Codegraph @

test/functional/cases/131_dkim_signing/004_invalidate_key.robot

raw
1 *** Settings ***
2 Force Tags isbroken
3 Suite Setup Key Invalidation Setup
4 Suite Teardown Key Invalidation Teardown
5 Library ${RSPAMD_TESTDIR}/lib/rspamd.py
6 Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
7 Variables ${RSPAMD_TESTDIR}/lib/vars.py
8
9 *** Variables ***
10 ${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim_signing/invalidate.conf
11 ${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
12 ${REDIS_SCOPE} Suite
13 ${RSPAMD_SCOPE} Suite
14 ${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
15
16 *** Test Cases ***
17 TEST SIGNED
18 ${result} = Scan Message With Rspamc ${MESSAGE} -u [email protected]
19 Check Rspamc ${result} DKIM-Signature:
20 Should Contain ${result.stdout} DKIM_SIGNED
21
22 TEST NOT SIGNED - MISSING KEY
23 [Setup] Delete Key
24 ${result} = Scan Message With Rspamc ${MESSAGE} -u [email protected]
25 Check Rspamc ${result} DKIM-Signature: inverse=1
26 Should Not Contain ${result.stdout} DKIM_SIGNED
27
28 TEST NOT SIGNED - KEY NO LONGER MATCHES
29 [Setup] Move Key
30 ${result} = Scan Message With Rspamc ${MESSAGE} -u [email protected]
31 Check Rspamc ${result} DKIM-Signature: inverse=1
32 Should Not Contain ${result.stdout} DKIM_SIGNED
33
34 *** Keywords ***
35 Key Invalidation Setup
36 ${key_dir} Make Temporary Directory
37 Set Suite Variable ${RSPAMD_KEY_DIR} ${key_dir}
38 Copy File ${RSPAMD_TESTDIR}/configs/dkim-eddsa.key ${RSPAMD_KEY_DIR}/dkim-eddsa.key
39 Rspamd Setup
40
41 Delete Key
42 Remove File ${RSPAMD_KEY_DIR}/dkim-eddsa.key
43
44 Move Key
45 Copy File ${RSPAMD_TESTDIR}/configs/dkim.key ${RSPAMD_KEY_DIR}/dkim-eddsa.key
46 Set Modified Time ${RSPAMD_KEY_DIR}/dkim-eddsa.key NOW + 3s
47
48 Key Invalidation Teardown
49 Cleanup Temporary Directory ${RSPAMD_KEY_DIR}
50 Rspamd Teardown