Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/net Clean up clunky eval strings
details: https://anonhg.NetBSD.org/src/rev/a128c5eede86
branches: trunk
changeset: 355559:a128c5eede86
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Thu Aug 03 03:16:26 2017 +0000
description:
Clean up clunky eval strings
- Remove unnecessary \ at EOL
- This allows to omit ; too
- Remove unnecessary quotes for arguments of atf_set
- Don't expand $DEBUG in eval
- We expect it's expanded on execution
Suggested by kre@
diffstat:
tests/net/carp/t_basic.sh | 34 ++++----
tests/net/if_gif/t_gif.sh | 28 ++++----
tests/net/if_l2tp/t_l2tp.sh | 28 ++++----
tests/net/ipsec/t_ipsec_ah_keys.sh | 26 +++---
tests/net/ipsec/t_ipsec_esp_keys.sh | 26 +++---
tests/net/ipsec/t_ipsec_gif.sh | 28 ++++----
tests/net/ipsec/t_ipsec_l2tp.sh | 28 ++++----
tests/net/ipsec/t_ipsec_misc.sh | 106 +++++++++++++++---------------
tests/net/ipsec/t_ipsec_sockopt.sh | 28 ++++----
tests/net/ipsec/t_ipsec_tcp.sh | 28 ++++----
tests/net/ipsec/t_ipsec_transport.sh | 28 ++++----
tests/net/ipsec/t_ipsec_tunnel.sh | 28 ++++----
tests/net/ipsec/t_ipsec_tunnel_ipcomp.sh | 28 ++++----
tests/net/ipsec/t_ipsec_tunnel_odd.sh | 28 ++++----
tests/net/mcast/t_mcast.sh | 44 ++++++------
tests/net/net/t_ipaddress.sh | 22 +++---
tests/net/npf/t_npf.sh | 14 ++--
tests/net/route/t_flags.sh | 28 ++++----
tests/net/route/t_flags6.sh | 28 ++++----
19 files changed, 304 insertions(+), 304 deletions(-)
diffs (truncated from 900 to 300 lines):
diff -r 5a8f4ba1309d -r a128c5eede86 tests/net/carp/t_basic.sh
--- a/tests/net/carp/t_basic.sh Thu Aug 03 03:12:02 2017 +0000
+++ b/tests/net/carp/t_basic.sh Thu Aug 03 03:16:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_basic.sh,v 1.6 2017/05/18 06:34:48 ozaki-r Exp $
+# $NetBSD: t_basic.sh,v 1.7 2017/08/03 03:16:26 ozaki-r Exp $
#
# Copyright (c) 2017 Internet Initiative Japan Inc.
# All rights reserved.
@@ -333,22 +333,22 @@
fi
atf_test_case ${name} cleanup
- eval " \
- ${name}_head() { \
- atf_set \"descr\" \"$desc\"; \
- atf_set \"require.progs\" \"rump_server\"; \
- }; \
- ${name}_body() { \
- $expected_failure_code \
- test_carp_handover_${ipproto} $halt $carpdevip; \
- if [ $halt != halt ]; then \
- rump_server_destroy_ifaces; \
- fi \
- }; \
- ${name}_cleanup() { \
- $DEBUG && dump; \
- cleanup; \
- } \
+ eval "
+ ${name}_head() {
+ atf_set descr \"$desc\"
+ atf_set require.progs rump_server
+ }
+ ${name}_body() {
+ $expected_failure_code
+ test_carp_handover_${ipproto} $halt $carpdevip
+ if [ $halt != halt ]; then
+ rump_server_destroy_ifaces
+ fi
+ }
+ ${name}_cleanup() {
+ \$DEBUG && dump
+ cleanup
+ }
"
atf_add_test_case ${name}
}
diff -r 5a8f4ba1309d -r a128c5eede86 tests/net/if_gif/t_gif.sh
--- a/tests/net/if_gif/t_gif.sh Thu Aug 03 03:12:02 2017 +0000
+++ b/tests/net/if_gif/t_gif.sh Thu Aug 03 03:16:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_gif.sh,v 1.10 2017/05/26 01:14:38 ozaki-r Exp $
+# $NetBSD: t_gif.sh,v 1.11 2017/08/03 03:16:26 ozaki-r Exp $
#
# Copyright (c) 2015 Internet Initiative Japan Inc.
# All rights reserved.
@@ -727,19 +727,19 @@
fulldesc="Does ${inner} over ${outer} if_gif ${desc}"
atf_test_case ${name} cleanup
- eval "${name}_head() { \
- atf_set \"descr\" \"${fulldesc}\"; \
- atf_set \"require.progs\" \"rump_server\"; \
- }; \
- ${name}_body() { \
- ${category}_setup ${inner} ${outer}; \
- ${category}_test ${inner} ${outer}; \
- ${category}_teardown ${inner} ${outer}; \
- rump_server_destroy_ifaces; \
- }; \
- ${name}_cleanup() { \
- $DEBUG && dump; \
- cleanup; \
+ eval "${name}_head() {
+ atf_set descr \"${fulldesc}\"
+ atf_set require.progs rump_server
+ }
+ ${name}_body() {
+ ${category}_setup ${inner} ${outer}
+ ${category}_test ${inner} ${outer}
+ ${category}_teardown ${inner} ${outer}
+ rump_server_destroy_ifaces
+ }
+ ${name}_cleanup() {
+ \$DEBUG && dump
+ cleanup
}"
atf_add_test_case ${name}
}
diff -r 5a8f4ba1309d -r a128c5eede86 tests/net/if_l2tp/t_l2tp.sh
--- a/tests/net/if_l2tp/t_l2tp.sh Thu Aug 03 03:12:02 2017 +0000
+++ b/tests/net/if_l2tp/t_l2tp.sh Thu Aug 03 03:16:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_l2tp.sh,v 1.2 2017/02/17 00:51:25 ozaki-r Exp $
+# $NetBSD: t_l2tp.sh,v 1.3 2017/08/03 03:16:26 ozaki-r Exp $
#
# Copyright (c) 2017 Internet Initiative Japan Inc.
# All rights reserved.
@@ -405,19 +405,19 @@
fulldesc="Does ${lan_mode} over ${wan_mode} if_l2tp ${desc}"
atf_test_case ${name} cleanup
- eval "${name}_head() { \
- atf_set \"descr\" \"${fulldesc}\"; \
- atf_set \"require.progs\" \"rump_server\"; \
- }; \
- ${name}_body() { \
- ${category}_setup ${lan_mode} ${wan_mode}; \
- ${category}_test ${lan_mode} ${wan_mode}; \
- ${category}_teardown ${lan_mode} ${wan_mode}; \
- rump_server_destroy_ifaces; \
- }; \
- ${name}_cleanup() { \
- $DEBUG && dump; \
- cleanup; \
+ eval "${name}_head() {
+ atf_set descr \"${fulldesc}\"
+ atf_set require.progs rump_server
+ }
+ ${name}_body() {
+ ${category}_setup ${lan_mode} ${wan_mode}
+ ${category}_test ${lan_mode} ${wan_mode}
+ ${category}_teardown ${lan_mode} ${wan_mode}
+ rump_server_destroy_ifaces
+ }
+ ${name}_cleanup() {
+ \$DEBUG && dump
+ cleanup
}"
atf_add_test_case ${name}
}
diff -r 5a8f4ba1309d -r a128c5eede86 tests/net/ipsec/t_ipsec_ah_keys.sh
--- a/tests/net/ipsec/t_ipsec_ah_keys.sh Thu Aug 03 03:12:02 2017 +0000
+++ b/tests/net/ipsec/t_ipsec_ah_keys.sh Thu Aug 03 03:16:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_ipsec_ah_keys.sh,v 1.1 2017/04/14 02:56:49 ozaki-r Exp $
+# $NetBSD: t_ipsec_ah_keys.sh,v 1.2 2017/08/03 03:16:27 ozaki-r Exp $
#
# Copyright (c) 2017 Internet Initiative Japan Inc.
# All rights reserved.
@@ -73,18 +73,18 @@
desc="Tests AH ($aalgo) valid keys"
atf_test_case ${name} cleanup
- eval " \
- ${name}_head() { \
- atf_set \"descr\" \"$desc\"; \
- atf_set \"require.progs\" \"rump_server\" \"setkey\"; \
- }; \
- ${name}_body() { \
- test_ah_valid_keys_common $aalgo; \
- }; \
- ${name}_cleanup() { \
- $DEBUG && dump; \
- cleanup; \
- } \
+ eval "
+ ${name}_head() {
+ atf_set descr \"$desc\"
+ atf_set require.progs rump_server setkey
+ }
+ ${name}_body() {
+ test_ah_valid_keys_common $aalgo
+ }
+ ${name}_cleanup() {
+ \$DEBUG && dump
+ cleanup
+ }
"
atf_add_test_case ${name}
}
diff -r 5a8f4ba1309d -r a128c5eede86 tests/net/ipsec/t_ipsec_esp_keys.sh
--- a/tests/net/ipsec/t_ipsec_esp_keys.sh Thu Aug 03 03:12:02 2017 +0000
+++ b/tests/net/ipsec/t_ipsec_esp_keys.sh Thu Aug 03 03:16:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_ipsec_esp_keys.sh,v 1.1 2017/04/14 02:56:49 ozaki-r Exp $
+# $NetBSD: t_ipsec_esp_keys.sh,v 1.2 2017/08/03 03:16:27 ozaki-r Exp $
#
# Copyright (c) 2017 Internet Initiative Japan Inc.
# All rights reserved.
@@ -73,18 +73,18 @@
desc="Tests ESP ($ealgo) valid keys"
atf_test_case ${name} cleanup
- eval " \
- ${name}_head() { \
- atf_set \"descr\" \"$desc\"; \
- atf_set \"require.progs\" \"rump_server\" \"setkey\"; \
- }; \
- ${name}_body() { \
- test_esp_valid_keys_common $ealgo; \
- }; \
- ${name}_cleanup() { \
- $DEBUG && dump; \
- cleanup; \
- } \
+ eval "
+ ${name}_head() {
+ atf_set descr \"$desc\"
+ atf_set require.progs rump_server setkey
+ }
+ ${name}_body() {
+ test_esp_valid_keys_common $ealgo
+ }
+ ${name}_cleanup() {
+ \$DEBUG && dump
+ cleanup
+ }
"
atf_add_test_case ${name}
}
diff -r 5a8f4ba1309d -r a128c5eede86 tests/net/ipsec/t_ipsec_gif.sh
--- a/tests/net/ipsec/t_ipsec_gif.sh Thu Aug 03 03:12:02 2017 +0000
+++ b/tests/net/ipsec/t_ipsec_gif.sh Thu Aug 03 03:16:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_ipsec_gif.sh,v 1.6 2017/06/14 02:33:37 ozaki-r Exp $
+# $NetBSD: t_ipsec_gif.sh,v 1.7 2017/08/03 03:16:27 ozaki-r Exp $
#
# Copyright (c) 2017 Internet Initiative Japan Inc.
# All rights reserved.
@@ -388,19 +388,19 @@
desc="Tests of gif/IPsec ($ipproto) ${mode} mode with $proto ($algo)"
atf_test_case ${name} cleanup
- eval " \
- ${name}_head() { \
- atf_set \"descr\" \"$desc\"; \
- atf_set \"require.progs\" \"rump_server\" \"setkey\"; \
- }; \
- ${name}_body() { \
- test_ipsec_gif_common $ipproto $mode $proto $algo; \
- rump_server_destroy_ifaces; \
- }; \
- ${name}_cleanup() { \
- $DEBUG && dump; \
- cleanup; \
- } \
+ eval "
+ ${name}_head() {
+ atf_set descr \"$desc\"
+ atf_set require.progs rump_server setkey
+ }
+ ${name}_body() {
+ test_ipsec_gif_common $ipproto $mode $proto $algo
+ rump_server_destroy_ifaces
+ }
+ ${name}_cleanup() {
+ \$DEBUG && dump
+ cleanup
+ }
"
atf_add_test_case ${name}
}
diff -r 5a8f4ba1309d -r a128c5eede86 tests/net/ipsec/t_ipsec_l2tp.sh
--- a/tests/net/ipsec/t_ipsec_l2tp.sh Thu Aug 03 03:12:02 2017 +0000
+++ b/tests/net/ipsec/t_ipsec_l2tp.sh Thu Aug 03 03:16:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_ipsec_l2tp.sh,v 1.6 2017/06/14 02:33:37 ozaki-r Exp $
+# $NetBSD: t_ipsec_l2tp.sh,v 1.7 2017/08/03 03:16:27 ozaki-r Exp $
#
# Copyright (c) 2017 Internet Initiative Japan Inc.
# All rights reserved.
@@ -374,19 +374,19 @@
desc="Tests of l2tp/IPsec ($ipproto) ${mode} mode with $proto ($algo)"
atf_test_case ${name} cleanup
- eval " \
- ${name}_head() { \
- atf_set \"descr\" \"$desc\"; \
- atf_set \"require.progs\" \"rump_server\" \"setkey\"; \
- }; \
- ${name}_body() { \
- test_ipsec_l2tp_common $ipproto $mode $proto $algo; \
- rump_server_destroy_ifaces; \
- }; \
- ${name}_cleanup() { \
- $DEBUG && dump; \
- cleanup; \
- } \
+ eval "
+ ${name}_head() {
+ atf_set descr \"$desc\"
+ atf_set require.progs rump_server setkey
+ }
+ ${name}_body() {
+ test_ipsec_l2tp_common $ipproto $mode $proto $algo
+ rump_server_destroy_ifaces
+ }
+ ${name}_cleanup() {
+ \$DEBUG && dump
+ cleanup
+ }
"
atf_add_test_case ${name}
}
diff -r 5a8f4ba1309d -r a128c5eede86 tests/net/ipsec/t_ipsec_misc.sh
--- a/tests/net/ipsec/t_ipsec_misc.sh Thu Aug 03 03:12:02 2017 +0000
+++ b/tests/net/ipsec/t_ipsec_misc.sh Thu Aug 03 03:16:26 2017 +0000
@@ -1,4 +1,4 @@
Home |
Main Index |
Thread Index |
Old Index