Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/net/if_gif Refactor. No functional change.
details: https://anonhg.NetBSD.org/src/rev/617870f5cbea
branches: trunk
changeset: 812448:617870f5cbea
user: knakahara <knakahara%NetBSD.org@localhost>
date: Wed Dec 16 03:24:29 2015 +0000
description:
Refactor. No functional change.
diffstat:
tests/net/if_gif/t_gif.sh | 433 +++++++++------------------------------------
1 files changed, 86 insertions(+), 347 deletions(-)
diffs (truncated from 516 to 300 lines):
diff -r 71efc3817a71 -r 617870f5cbea tests/net/if_gif/t_gif.sh
--- a/tests/net/if_gif/t_gif.sh Wed Dec 16 01:20:05 2015 +0000
+++ b/tests/net/if_gif/t_gif.sh Wed Dec 16 03:24:29 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_gif.sh,v 1.3 2015/12/08 05:56:18 knakahara Exp $
+# $NetBSD: t_gif.sh,v 1.4 2015/12/16 03:24:29 knakahara Exp $
#
# Copyright (c) 2015 Internet Initiative Japan Inc.
# All rights reserved.
@@ -67,91 +67,6 @@
TIMEOUT=5
-atf_test_case basicv4overv4 cleanup
-atf_test_case basicv4overv6 cleanup
-atf_test_case basicv6overv4 cleanup
-atf_test_case basicv6overv6 cleanup
-atf_test_case ioctlv4overv4 cleanup
-atf_test_case ioctlv4overv6 cleanup
-atf_test_case ioctlv6overv4 cleanup
-atf_test_case ioctlv6overv6 cleanup
-atf_test_case recursivev4overv4 cleanup
-atf_test_case recursivev4overv6 cleanup
-atf_test_case recursivev6overv4 cleanup
-atf_test_case recursivev6overv6 cleanup
-
-basicv4overv4_head()
-{
- atf_set "descr" "Does IPv4 over IPv4 if_gif basic tests"
- atf_set "require.progs" "rump_server"
-}
-
-basicv4overv6_head()
-{
- atf_set "descr" "Does IPv4 over IPv6 if_gif basic tests"
- atf_set "require.progs" "rump_server"
-}
-
-basicv6overv4_head()
-{
- atf_set "descr" "Does IPv6 over IPv4 if_gif basic tests"
- atf_set "require.progs" "rump_server"
-}
-
-basicv6overv6_head()
-{
- atf_set "descr" "Does IPv6 over IPv6 if_gif basic tests"
- atf_set "require.progs" "rump_server"
-}
-
-ioctlv4overv4_head()
-{
- atf_set "descr" "Does IPv4 over IPv4 if_gif ioctl tests"
- atf_set "require.progs" "rump_server"
-}
-
-ioctlv4overv6_head()
-{
- atf_set "descr" "Does IPv4 over IPv6 if_gif ioctl tests"
- atf_set "require.progs" "rump_server"
-}
-
-ioctlv6overv4_head()
-{
- atf_set "descr" "Does IPv6 over IPv4 if_gif ioctl tests"
- atf_set "require.progs" "rump_server"
-}
-
-ioctlv6overv6_head()
-{
- atf_set "descr" "Does IPv6 over IPv6 if_gif ioctl tests"
- atf_set "require.progs" "rump_server"
-}
-
-recursivev4overv4_head()
-{
- atf_set "descr" "Does IPv4 over IPv4 if_gif recursive check tests"
- atf_set "require.progs" "rump_server"
-}
-
-recursivev4overv6_head()
-{
- atf_set "descr" "Does IPv4 over IPv6 if_gif recursive check tests"
- atf_set "require.progs" "rump_server"
-}
-
-recursivev6overv4_head()
-{
- atf_set "descr" "Does IPv6 over IPv4 if_gif recursive check tests"
- atf_set "require.progs" "rump_server"
-}
-
-recursivev6overv6_head()
-{
- atf_set "descr" "Does IPv6 over IPv6 if_gif recursive check tests"
- atf_set "require.progs" "rump_server"
-}
-
setup_router()
{
sock=${1}
@@ -711,329 +626,153 @@
rump.ifconfig -v gif0
}
-basicv4overv4_body()
-{
- setup ipv4 ipv4
- test_setup ipv4 ipv4
-
- # Enable once PR kern/49219 is fixed
- #test_ping_failure
-
- setup_tunnel ipv4 ipv4
- sleep 1
- test_setup_tunnel ipv4
- test_ping_success ipv4
-
- teardown_tunnel
- test_ping_failure ipv4
-}
-
-basicv4overv6_body()
+basic_setup()
{
- setup ipv4 ipv6
- test_setup ipv4 ipv6
-
- # Enable once PR kern/49219 is fixed
- #test_ping_failure
+ inner=$1
+ outer=$2
- setup_tunnel ipv4 ipv6
- sleep 1
- test_setup_tunnel ipv4
- test_ping_success ipv4
-
- teardown_tunnel
- test_ping_failure ipv4
-}
-
-basicv6overv4_body()
-{
- setup ipv6 ipv4
- test_setup ipv6 ipv4
+ setup ${inner} ${outer}
+ test_setup ${inner} ${outer}
# Enable once PR kern/49219 is fixed
#test_ping_failure
- setup_tunnel ipv6 ipv4
+ setup_tunnel ${inner} ${outer}
sleep 1
- test_setup_tunnel ipv6
- test_ping_success ipv6
-
- teardown_tunnel
- test_ping_failure ipv6
+ test_setup_tunnel ${inner}
}
-basicv6overv6_body()
+basic_test()
{
- setup ipv6 ipv6
- test_setup ipv6 ipv6
-
- # Enable once PR kern/49219 is fixed
- #test_ping_failure
+ inner=$1
+ outer=$2 # not use
- setup_tunnel ipv6 ipv6
- sleep 1
- test_setup_tunnel ipv6
- test_ping_success ipv6
-
- teardown_tunnel
- test_ping_failure ipv6
+ test_ping_success ${inner}
}
-basicv4overv4_cleanup()
+basic_teardown()
{
- dump_bus
- cleanup
-}
+ inner=$1
+ outer=$2 # not use
-basicv4overv6_cleanup()
-{
- dump_bus
- cleanup
+ teardown_tunnel
+ test_ping_failure ${inner}
}
-basicv6overv4_cleanup()
-{
- dump_bus
- cleanup
-}
-
-basicv6overv6_cleanup()
+ioctl_setup()
{
- dump_bus
- cleanup
-}
+ inner=$1
+ outer=$2
-ioctlv4overv4_body()
-{
- setup ipv4 ipv4
- test_setup ipv4 ipv4
+ setup ${inner} ${outer}
+ test_setup ${inner} ${outer}
# Enable once PR kern/49219 is fixed
#test_ping_failure
- setup_tunnel ipv4 ipv4
- setup_dummy_tunnel ipv4 ipv4
+ setup_tunnel ${inner} ${outer}
+ setup_dummy_tunnel ${inner} ${outer}
sleep 1
- test_setup_tunnel ipv4
- test_setup_dummy_tunnel
- test_ping_success ipv4
-
- test_change_tunnel_duplicate ipv4
-
- teardown_dummy_tunnel
- test_change_tunnel_success ipv4
-
- teardown_tunnel
- test_ping_failure ipv4
+ test_setup_tunnel ${inner}
}
-ioctlv4overv6_body()
+ioctl_test()
{
- setup ipv4 ipv6
- test_setup ipv4 ipv6
-
- # Enable once PR kern/49219 is fixed
- #test_ping_failure
+ inner=$1
+ outer=$2
- setup_tunnel ipv4 ipv6
- setup_dummy_tunnel ipv4 ipv6
- sleep 1
- test_setup_tunnel ipv4
- test_setup_dummy_tunnel
- test_ping_success ipv4
+ test_ping_success ${inner}
- test_change_tunnel_duplicate ipv6
+ test_change_tunnel_duplicate ${outer}
teardown_dummy_tunnel
- test_change_tunnel_success ipv6
+ test_change_tunnel_success ${outer}
+}
+
+ioctl_teardown()
+{
+ inner=$1
+ outer=$2 # not use
teardown_tunnel
- test_ping_failure ipv4
+ test_ping_failure ${inner}
}
-ioctlv6overv4_body()
+recursive_setup()
{
- setup ipv6 ipv4
- test_setup ipv6 ipv4
+ inner=$1
+ outer=$2
+
+ setup ${inner} ${outer}
+ test_setup ${inner} ${outer}
# Enable once PR kern/49219 is fixed
#test_ping_failure
- setup_tunnel ipv6 ipv4
- setup_dummy_tunnel ipv6 ipv4
+ setup_tunnel ${inner} ${outer}
+ setup_recursive_tunnels ${inner}
Home |
Main Index |
Thread Index |
Old Index