Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/net/if_clone_test.sh
Show All 33 Lines | |||||
# Outline: | # Outline: | ||||
# For each cloned interface type, do three tests | # For each cloned interface type, do three tests | ||||
# 1) Create and destroy it | # 1) Create and destroy it | ||||
# 2) Create, up, and destroy it | # 2) Create, up, and destroy it | ||||
# 3) Create, disable IPv6 auto address assignment, up, and destroy it | # 3) Create, disable IPv6 auto address assignment, up, and destroy it | ||||
TESTLEN=10 # seconds | TESTLEN=10 # seconds | ||||
atf_test_case epair_stress cleanup | |||||
epair_stress_head() | |||||
{ | |||||
atf_set "descr" "Simultaneously create and destroy an epair(4)" | |||||
atf_set "require.user" "root" | |||||
} | |||||
epair_stress_body() | |||||
{ | |||||
do_stress "epair" | |||||
} | |||||
epair_stress_cleanup() | |||||
{ | |||||
cleanup_ifaces | |||||
} | |||||
atf_test_case epair_up_stress cleanup | |||||
epair_up_stress_head() | |||||
{ | |||||
atf_set "descr" "Simultaneously up and detroy an epair(4)" | |||||
atf_set "require.user" "root" | |||||
} | |||||
epair_up_stress_body() | |||||
{ | |||||
do_up_stress "epair" "" "" | |||||
} | |||||
epair_up_stress_cleanup() | |||||
{ | |||||
cleanup_ifaces | |||||
} | |||||
atf_test_case epair_ipv6_up_stress cleanup | |||||
epair_ipv6_up_stress_head() | |||||
{ | |||||
atf_set "descr" "Simultaneously up and destroy an epair(4) with IPv6" | |||||
atf_set "require.user" "root" | |||||
} | |||||
epair_ipv6_up_stress_body() | |||||
{ | |||||
do_up_stress "epair" "6" "" | |||||
} | |||||
epair_ipv6_up_stress_cleanup() | |||||
{ | |||||
cleanup_ifaces | |||||
} | |||||
atf_test_case faith_stress cleanup | atf_test_case faith_stress cleanup | ||||
faith_stress_head() | faith_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously create and destroy a faith(4)" | atf_set "descr" "Simultaneously create and destroy a faith(4)" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
faith_stress_body() | faith_stress_body() | ||||
{ | { | ||||
do_stress "faith" | do_stress "faith" | ||||
} | } | ||||
faith_stress_cleanup() | faith_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case faith_up_stress cleanup | atf_test_case faith_up_stress cleanup | ||||
faith_up_stress_head() | faith_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a faith(4)" | atf_set "descr" "Simultaneously up and destroy a faith(4)" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
faith_up_stress_body() | faith_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "faith" "" "" | do_up_stress "faith" "" "" | ||||
} | } | ||||
faith_up_stress_cleanup() | faith_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case faith_ipv6_up_stress cleanup | atf_test_case faith_ipv6_up_stress cleanup | ||||
faith_ipv6_up_stress_head() | faith_ipv6_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a faith(4) with IPv6" | atf_set "descr" "Simultaneously up and destroy a faith(4) with IPv6" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
faith_ipv6_up_stress_body() | faith_ipv6_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "faith" "6" "" | do_up_stress "faith" "6" "" | ||||
} | } | ||||
faith_ipv6_up_stress_cleanup() | faith_ipv6_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case gif_stress cleanup | atf_test_case gif_stress cleanup | ||||
Show All 14 Lines | |||||
atf_test_case gif_up_stress cleanup | atf_test_case gif_up_stress cleanup | ||||
gif_up_stress_head() | gif_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a gif(4)" | atf_set "descr" "Simultaneously up and destroy a gif(4)" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
gif_up_stress_body() | gif_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "gif" "" "p2p" | do_up_stress "gif" "" "p2p" | ||||
} | } | ||||
gif_up_stress_cleanup() | gif_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case gif_ipv6_up_stress cleanup | atf_test_case gif_ipv6_up_stress cleanup | ||||
gif_ipv6_up_stress_head() | gif_ipv6_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a gif(4) with IPv6" | atf_set "descr" "Simultaneously up and destroy a gif(4) with IPv6" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
gif_ipv6_up_stress_body() | gif_ipv6_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: rt_tables_get_rnh_ptr: fam out of bounds." | |||||
do_up_stress "gif" "6" "p2p" | do_up_stress "gif" "6" "p2p" | ||||
} | } | ||||
gif_ipv6_up_stress_cleanup() | gif_ipv6_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case lo_stress cleanup | atf_test_case lo_stress cleanup | ||||
Show All 14 Lines | |||||
atf_test_case lo_up_stress cleanup | atf_test_case lo_up_stress cleanup | ||||
lo_up_stress_head() | lo_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy an lo(4)" | atf_set "descr" "Simultaneously up and destroy an lo(4)" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
lo_up_stress_body() | lo_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: GPF in rtsock_routemsg" | |||||
do_up_stress "lo" "" "" | do_up_stress "lo" "" "" | ||||
} | } | ||||
lo_up_stress_cleanup() | lo_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case lo_ipv6_up_stress cleanup | atf_test_case lo_ipv6_up_stress cleanup | ||||
lo_ipv6_up_stress_head() | lo_ipv6_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy an lo(4) with IPv6" | atf_set "descr" "Simultaneously up and destroy an lo(4) with IPv6" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
lo_ipv6_up_stress_body() | lo_ipv6_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: page fault in rtsock_addrmsg" | |||||
do_up_stress "lo" "6" "" | do_up_stress "lo" "6" "" | ||||
} | } | ||||
lo_ipv6_up_stress_cleanup() | lo_ipv6_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case tap_stress cleanup | atf_test_case tap_stress cleanup | ||||
Show All 14 Lines | |||||
atf_test_case tap_up_stress cleanup | atf_test_case tap_up_stress cleanup | ||||
tap_up_stress_head() | tap_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a tap(4)" | atf_set "descr" "Simultaneously up and destroy a tap(4)" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
tap_up_stress_body() | tap_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "tap" "" "" | do_up_stress "tap" "" "" | ||||
} | } | ||||
tap_up_stress_cleanup() | tap_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case tap_ipv6_up_stress cleanup | atf_test_case tap_ipv6_up_stress cleanup | ||||
tap_ipv6_up_stress_head() | tap_ipv6_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a tap(4) with IPv6" | atf_set "descr" "Simultaneously up and destroy a tap(4) with IPv6" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
tap_ipv6_up_stress_body() | tap_ipv6_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_delmulti_locked: inconsistent ifp 0xfffff80150e44000" | |||||
do_up_stress "tap" "6" "" | do_up_stress "tap" "6" "" | ||||
} | } | ||||
tap_ipv6_up_stress_cleanup() | tap_ipv6_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case tun_stress cleanup | atf_test_case tun_stress cleanup | ||||
Show All 14 Lines | |||||
atf_test_case tun_up_stress cleanup | atf_test_case tun_up_stress cleanup | ||||
tun_up_stress_head() | tun_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a tun(4)" | atf_set "descr" "Simultaneously up and destroy a tun(4)" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
tun_up_stress_body() | tun_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "tun" "" "p2p" | do_up_stress "tun" "" "p2p" | ||||
} | } | ||||
tun_up_stress_cleanup() | tun_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case tun_ipv6_up_stress cleanup | atf_test_case tun_ipv6_up_stress cleanup | ||||
tun_ipv6_up_stress_head() | tun_ipv6_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a tun(4) with IPv6" | atf_set "descr" "Simultaneously up and destroy a tun(4) with IPv6" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
tun_ipv6_up_stress_body() | tun_ipv6_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "tun" "6" "p2p" | do_up_stress "tun" "6" "p2p" | ||||
} | } | ||||
tun_ipv6_up_stress_cleanup() | tun_ipv6_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case vlan_stress cleanup | atf_test_case vlan_stress cleanup | ||||
Show All 14 Lines | |||||
atf_test_case vlan_up_stress cleanup | atf_test_case vlan_up_stress cleanup | ||||
vlan_up_stress_head() | vlan_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a vlan(4)" | atf_set "descr" "Simultaneously up and destroy a vlan(4)" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
vlan_up_stress_body() | vlan_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "vlan" "" "" | do_up_stress "vlan" "" "" | ||||
} | } | ||||
vlan_up_stress_cleanup() | vlan_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case vlan_ipv6_up_stress cleanup | atf_test_case vlan_ipv6_up_stress cleanup | ||||
vlan_ipv6_up_stress_head() | vlan_ipv6_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a vlan(4) with IPv6" | atf_set "descr" "Simultaneously up and destroy a vlan(4) with IPv6" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
vlan_ipv6_up_stress_body() | vlan_ipv6_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "vlan" "6" "" | do_up_stress "vlan" "6" "" | ||||
} | } | ||||
vlan_ipv6_up_stress_cleanup() | vlan_ipv6_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_test_case vmnet_stress cleanup | atf_test_case vmnet_stress cleanup | ||||
Show All 29 Lines | |||||
atf_test_case vmnet_ipv6_up_stress cleanup | atf_test_case vmnet_ipv6_up_stress cleanup | ||||
vmnet_ipv6_up_stress_head() | vmnet_ipv6_up_stress_head() | ||||
{ | { | ||||
atf_set "descr" "Simultaneously up and destroy a vmnet(4) with IPv6" | atf_set "descr" "Simultaneously up and destroy a vmnet(4) with IPv6" | ||||
atf_set "require.user" "root" | atf_set "require.user" "root" | ||||
} | } | ||||
vmnet_ipv6_up_stress_body() | vmnet_ipv6_up_stress_body() | ||||
{ | { | ||||
atf_skip "Quickly panics: if_freemulti: protospec not NULL" | |||||
do_up_stress "vmnet" "6" "" | do_up_stress "vmnet" "6" "" | ||||
} | } | ||||
vmnet_ipv6_up_stress_cleanup() | vmnet_ipv6_up_stress_cleanup() | ||||
{ | { | ||||
cleanup_ifaces | cleanup_ifaces | ||||
} | } | ||||
atf_init_test_cases() | atf_init_test_cases() | ||||
{ | { | ||||
# TODO: add epair(4) tests, which need a different syntax | atf_add_test_case epair_ipv6_up_stress | ||||
atf_add_test_case epair_stress | |||||
atf_add_test_case epair_up_stress | |||||
atf_add_test_case faith_ipv6_up_stress | atf_add_test_case faith_ipv6_up_stress | ||||
atf_add_test_case faith_stress | atf_add_test_case faith_stress | ||||
atf_add_test_case faith_up_stress | atf_add_test_case faith_up_stress | ||||
atf_add_test_case gif_ipv6_up_stress | atf_add_test_case gif_ipv6_up_stress | ||||
atf_add_test_case gif_stress | atf_add_test_case gif_stress | ||||
atf_add_test_case gif_up_stress | atf_add_test_case gif_up_stress | ||||
# Don't test lagg; it has its own test program | # Don't test lagg; it has its own test program | ||||
atf_add_test_case lo_ipv6_up_stress | atf_add_test_case lo_ipv6_up_stress | ||||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
cleanup_ifaces() | cleanup_ifaces() | ||||
{ | { | ||||
local DEV | local DEV | ||||
for DEV in `cat "devices_to_cleanup"`; do | for DEV in `cat "devices_to_cleanup"`; do | ||||
if [ ${DEV%%[0-9]*a} = "epair" ]; then | if [ ${DEV%%[0-9]*} = "epair" ]; then | ||||
ifconfig ${DEV}a destroy | ifconfig ${DEV}a destroy | ||||
else | else | ||||
ifconfig ${DEV} destroy | ifconfig ${DEV} destroy | ||||
fi | fi | ||||
done | done | ||||
true | true | ||||
} | } |