From 02d92cc60945529eac681b0797704aba53a0720d Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Sun, 3 Dec 2017 18:35:07 +0000 Subject: [PATCH] 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@ --- tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh | 10 ++++++---- tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh | 10 ++++++---- tests/sys/netipsec/tunnel/aes_gcm_128.sh | 10 ++++++---- tests/sys/netipsec/tunnel/aes_gcm_256.sh | 10 ++++++---- .../sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1.sh | 10 ++++++---- .../netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256.sh | 10 ++++++---- tests/sys/netipsec/tunnel/aesni_aes_gcm_128.sh | 10 ++++++---- tests/sys/netipsec/tunnel/aesni_aes_gcm_256.sh | 10 ++++++---- 8 files changed, 48 insertions(+), 32 deletions(-) diff --git a/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh b/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh index 1b072c72063d..076f8464e4c0 100755 --- a/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh +++ b/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh @@ -7,12 +7,13 @@ v4_head() { atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1' atf_set require.user root - # Unload AESNI module if loaded - kldstat -q -n aesni && kldunload aesni } v4_body() { + # Unload AESNI module if loaded + kldstat -q -n aesni && kldunload aesni + 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 require.user root - # Unload AESNI module if loaded - kldstat -q -n aesni && kldunload aesni } v6_body() { + # Unload AESNI module if loaded + kldstat -q -n aesni && kldunload aesni + ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" } diff --git a/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh b/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh index 00a0b57bf238..c48791543ad4 100755 --- a/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh +++ b/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh @@ -7,12 +7,13 @@ v4_head() { atf_set descr 'IPSec inet4 tunnel using aes-cbc-256-hmac-sha2-256' atf_set require.user root - # load AESNI module if not already - kldstat -q -n aesni || kldload aesni } v4_body() { + # load AESNI module if not already + kldstat -q -n aesni || kldload aesni + 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 require.user root - # load AESNI module if not already - kldstat -q -n aesni || kldload aesni } v6_body() { + # load AESNI module if not already + kldstat -q -n aesni || kldload aesni + ist_test 6 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012" } diff --git a/tests/sys/netipsec/tunnel/aes_gcm_128.sh b/tests/sys/netipsec/tunnel/aes_gcm_128.sh index d78e853937cc..093facb6c0d0 100755 --- a/tests/sys/netipsec/tunnel/aes_gcm_128.sh +++ b/tests/sys/netipsec/tunnel/aes_gcm_128.sh @@ -7,12 +7,13 @@ v4_head() { atf_set descr 'IPSec inet4 tunnel using aes-gcm-128' atf_set require.user root - # Unload AESNI module if loaded - kldstat -q -n aesni && kldunload aesni } v4_body() { + # Unload AESNI module if loaded + kldstat -q -n aesni && kldunload aesni + 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 require.user root - # Unload AESNI module if loaded - kldstat -q -n aesni && kldunload aesni } v6_body() { + # Unload AESNI module if loaded + kldstat -q -n aesni && kldunload aesni + ist_test 6 aes-gcm-16 "12345678901234567890" } diff --git a/tests/sys/netipsec/tunnel/aes_gcm_256.sh b/tests/sys/netipsec/tunnel/aes_gcm_256.sh index 2c41a98e1e8b..ee88cd3c61e4 100755 --- a/tests/sys/netipsec/tunnel/aes_gcm_256.sh +++ b/tests/sys/netipsec/tunnel/aes_gcm_256.sh @@ -7,12 +7,13 @@ v4_head() { atf_set descr 'IPSec inet4 tunnel using aes-gcm-256' atf_set require.user root - # Unload AESNI module if loaded - kldstat -q -n aesni && kldunload aesni } v4_body() { + # Unload AESNI module if loaded + kldstat -q -n aesni && kldunload aesni + 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 require.user root - # Unload AESNI module if loaded - kldstat -q -n aesni && kldunload aesni } v6_body() { + # Unload AESNI module if loaded + kldstat -q -n aesni && kldunload aesni + ist_test 6 aes-gcm-16 "123456789012345678901234567890123456" } diff --git a/tests/sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1.sh b/tests/sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1.sh index d2c717120dd5..9441abe39736 100755 --- a/tests/sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1.sh +++ b/tests/sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1.sh @@ -7,12 +7,13 @@ v4_head() { atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1 and AESNI' atf_set require.user root - # load AESNI module if not already - kldstat -q -n aesni || kldload aesni } v4_body() { + # load AESNI module if not already + kldstat -q -n aesni || kldload aesni + 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 require.user root - # load AESNI module if not already - kldstat -q -n aesni || kldload aesni } v6_body() { + # load AESNI module if not already + kldstat -q -n aesni || kldload aesni + ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 "12345678901234567890" } diff --git a/tests/sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256.sh b/tests/sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256.sh index 95b7e5e6db3e..2d34e9307753 100755 --- a/tests/sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256.sh +++ b/tests/sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256.sh @@ -7,12 +7,13 @@ v4_head() { atf_set descr 'IPSec inet4 tunnel using aes-cbc-256-hmac-sha2-256 and AESNI' atf_set require.user root - # Unload AESNI module if loaded - kldstat -q -n aesni && kldunload aesni } v4_body() { + # Unload AESNI module if loaded + kldstat -q -n aesni && kldunload aesni + 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 require.user root - # Unload AESNI module if loaded - kldstat -q -n aesni && kldunload aesni } v6_body() { + # Unload AESNI module if loaded + kldstat -q -n aesni && kldunload aesni + ist_test 6 rijndael-cbc "12345678901234567890123456789012" hmac-sha2-256 "12345678901234567890123456789012" } diff --git a/tests/sys/netipsec/tunnel/aesni_aes_gcm_128.sh b/tests/sys/netipsec/tunnel/aesni_aes_gcm_128.sh index d192ecf27348..ebf521ef7cdd 100755 --- a/tests/sys/netipsec/tunnel/aesni_aes_gcm_128.sh +++ b/tests/sys/netipsec/tunnel/aesni_aes_gcm_128.sh @@ -7,12 +7,13 @@ v4_head() { atf_set descr 'IPSec inet4 tunnel using aes-gcm-128 and AESNI' atf_set require.user root - # load AESNI module if not already - kldstat -q -n aesni || kldload aesni } v4_body() { + # load AESNI module if not already + kldstat -q -n aesni || kldload aesni + 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 require.user root - # load AESNI module if not already - kldstat -q -n aesni || kldload aesni } v6_body() { + # load AESNI module if not already + kldstat -q -n aesni || kldload aesni + atf_expect_fail "PR 201447" ist_test 6 aes-gcm-16 "12345678901234567890" } diff --git a/tests/sys/netipsec/tunnel/aesni_aes_gcm_256.sh b/tests/sys/netipsec/tunnel/aesni_aes_gcm_256.sh index 2015287848d8..5ddf3e7d4fb0 100755 --- a/tests/sys/netipsec/tunnel/aesni_aes_gcm_256.sh +++ b/tests/sys/netipsec/tunnel/aesni_aes_gcm_256.sh @@ -7,12 +7,13 @@ v4_head() { atf_set descr 'IPSec inet4 tunnel using aes-gcm-256 and AESNI' atf_set require.user root - # load AESNI module if not already - kldstat -q -n aesni || kldload aesni } v4_body() { + # load AESNI module if not already + kldstat -q -n aesni || kldload aesni + 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 require.user root - # load AESNI module if not already - kldstat -q -n aesni || kldload aesni } v6_body() { + # load AESNI module if not already + kldstat -q -n aesni || kldload aesni + atf_expect_fail "PR 201447" ist_test 6 aes-gcm-16 "123456789012345678901234567890123456" }