tests: ipsec: Don't load/unload aesni.ko in the test header

We can't kldunload in the test head as Kyua interprets any output from
them. This would lead to syntax errors and skipping the entire file.

Move the kld commands into the test case bodies.

Pointed out by: asomers@
This commit is contained in:
Kristof Provost 2017-12-03 18:35:07 +00:00
parent 04006780d9
commit 02d92cc609
8 changed files with 48 additions and 32 deletions

View File

@ -7,12 +7,13 @@ v4_head()
{ {
atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1' atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1'
atf_set require.user root atf_set require.user root
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
} }
v4_body() v4_body()
{ {
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890"
} }
@ -26,12 +27,13 @@ v6_head()
{ {
atf_set descr 'IPSec inet6 tunnel using aes-cbc-128-hmac-sha1' atf_set descr 'IPSec inet6 tunnel using aes-cbc-128-hmac-sha1'
atf_set require.user root atf_set require.user root
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
} }
v6_body() v6_body()
{ {
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890"
} }

View File

@ -7,12 +7,13 @@ v4_head()
{ {
atf_set descr 'IPSec inet4 tunnel using aes-cbc-256-hmac-sha2-256' atf_set descr 'IPSec inet4 tunnel using aes-cbc-256-hmac-sha2-256'
atf_set require.user root atf_set require.user root
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
} }
v4_body() v4_body()
{ {
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
ist_test 4 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012" ist_test 4 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012"
} }
@ -26,12 +27,13 @@ v6_head()
{ {
atf_set descr 'IPSec inet6 tunnel using aes-cbc-256-hmac-sha2-256' atf_set descr 'IPSec inet6 tunnel using aes-cbc-256-hmac-sha2-256'
atf_set require.user root atf_set require.user root
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
} }
v6_body() v6_body()
{ {
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
ist_test 6 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012" ist_test 6 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012"
} }

View File

@ -7,12 +7,13 @@ v4_head()
{ {
atf_set descr 'IPSec inet4 tunnel using aes-gcm-128' atf_set descr 'IPSec inet4 tunnel using aes-gcm-128'
atf_set require.user root atf_set require.user root
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
} }
v4_body() v4_body()
{ {
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
ist_test 4 aes-gcm-16 "12345678901234567890" ist_test 4 aes-gcm-16 "12345678901234567890"
} }
@ -26,12 +27,13 @@ v6_head()
{ {
atf_set descr 'IPSec inet6 tunnel using aes-gcm-128' atf_set descr 'IPSec inet6 tunnel using aes-gcm-128'
atf_set require.user root atf_set require.user root
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
} }
v6_body() v6_body()
{ {
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
ist_test 6 aes-gcm-16 "12345678901234567890" ist_test 6 aes-gcm-16 "12345678901234567890"
} }

View File

@ -7,12 +7,13 @@ v4_head()
{ {
atf_set descr 'IPSec inet4 tunnel using aes-gcm-256' atf_set descr 'IPSec inet4 tunnel using aes-gcm-256'
atf_set require.user root atf_set require.user root
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
} }
v4_body() v4_body()
{ {
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
ist_test 4 aes-gcm-16 "123456789012345678901234567890123456" ist_test 4 aes-gcm-16 "123456789012345678901234567890123456"
} }
@ -26,12 +27,13 @@ v6_head()
{ {
atf_set descr 'IPSec inet6 tunnel using aes-gcm-256' atf_set descr 'IPSec inet6 tunnel using aes-gcm-256'
atf_set require.user root atf_set require.user root
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
} }
v6_body() v6_body()
{ {
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
ist_test 6 aes-gcm-16 "123456789012345678901234567890123456" ist_test 6 aes-gcm-16 "123456789012345678901234567890123456"
} }

View File

@ -7,12 +7,13 @@ v4_head()
{ {
atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1 and AESNI' atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1 and AESNI'
atf_set require.user root atf_set require.user root
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
} }
v4_body() v4_body()
{ {
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890"
} }
@ -26,12 +27,13 @@ v6_head()
{ {
atf_set descr 'IPSec inet6 tunnel using aes-cbc-128-hmac-sha1 and AESNI' atf_set descr 'IPSec inet6 tunnel using aes-cbc-128-hmac-sha1 and AESNI'
atf_set require.user root atf_set require.user root
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
} }
v6_body() v6_body()
{ {
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890"
} }

View File

@ -7,12 +7,13 @@ v4_head()
{ {
atf_set descr 'IPSec inet4 tunnel using aes-cbc-256-hmac-sha2-256 and AESNI' atf_set descr 'IPSec inet4 tunnel using aes-cbc-256-hmac-sha2-256 and AESNI'
atf_set require.user root atf_set require.user root
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
} }
v4_body() v4_body()
{ {
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
ist_test 4 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012" ist_test 4 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012"
} }
@ -26,12 +27,13 @@ v6_head()
{ {
atf_set descr 'IPSec inet6 tunnel using aes-cbc-256-hmac-sha2-256 and AESNI' atf_set descr 'IPSec inet6 tunnel using aes-cbc-256-hmac-sha2-256 and AESNI'
atf_set require.user root atf_set require.user root
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
} }
v6_body() v6_body()
{ {
# Unload AESNI module if loaded
kldstat -q -n aesni && kldunload aesni
ist_test 6 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012" ist_test 6 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012"
} }

View File

@ -7,12 +7,13 @@ v4_head()
{ {
atf_set descr 'IPSec inet4 tunnel using aes-gcm-128 and AESNI' atf_set descr 'IPSec inet4 tunnel using aes-gcm-128 and AESNI'
atf_set require.user root atf_set require.user root
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
} }
v4_body() v4_body()
{ {
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
ist_test 4 aes-gcm-16 "12345678901234567890" ist_test 4 aes-gcm-16 "12345678901234567890"
} }
@ -26,12 +27,13 @@ v6_head()
{ {
atf_set descr 'IPSec inet6 tunnel using aes-gcm-128 and AESNI' atf_set descr 'IPSec inet6 tunnel using aes-gcm-128 and AESNI'
atf_set require.user root atf_set require.user root
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
} }
v6_body() v6_body()
{ {
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
atf_expect_fail "PR 201447" atf_expect_fail "PR 201447"
ist_test 6 aes-gcm-16 "12345678901234567890" ist_test 6 aes-gcm-16 "12345678901234567890"
} }

View File

@ -7,12 +7,13 @@ v4_head()
{ {
atf_set descr 'IPSec inet4 tunnel using aes-gcm-256 and AESNI' atf_set descr 'IPSec inet4 tunnel using aes-gcm-256 and AESNI'
atf_set require.user root atf_set require.user root
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
} }
v4_body() v4_body()
{ {
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
ist_test 4 aes-gcm-16 "123456789012345678901234567890123456" ist_test 4 aes-gcm-16 "123456789012345678901234567890123456"
} }
@ -26,12 +27,13 @@ v6_head()
{ {
atf_set descr 'IPSec inet6 tunnel using aes-gcm-256 and AESNI' atf_set descr 'IPSec inet6 tunnel using aes-gcm-256 and AESNI'
atf_set require.user root atf_set require.user root
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
} }
v6_body() v6_body()
{ {
# load AESNI module if not already
kldstat -q -n aesni || kldload aesni
atf_expect_fail "PR 201447" atf_expect_fail "PR 201447"
ist_test 6 aes-gcm-16 "123456789012345678901234567890123456" ist_test 6 aes-gcm-16 "123456789012345678901234567890123456"
} }