Lines Matching +full:2 +full:ns
98 …"Check QEMU successfully starts one VM in a global ns and then another VM in a local ns with the s…
101 …"Check QEMU successfully starts one VM in a local ns and then another VM in a global ns with the s…
104 "Run vsock_test client in global ns with server in VM in another global ns."
107 "Run socat to test a process in a global ns fails to connect to a VM in a local ns."
110 "Run vsock_test client in VM in a global ns with server in another global ns."
113 "Run socat to test a VM in a global ns fails to connect to a host process in a local ns."
116 "Run socat to test a host process in a local ns fails to connect to a VM in another local ns."
119 "Run socat to test a VM in a local ns fails to connect to a host process in another local ns."
122 "Run socat to test a loopback vsock in a global ns fails to connect to a vsock in a local ns."
125 "Run socat to test a loopback vsock in a local ns fails to connect to a vsock in a global ns."
128 "Run socat to test a loopback vsock in a local ns fails to connect to a vsock in another local ns."
131 …"Run socat to test a loopback vsock in a global ns successfully connects to a vsock in another glo…
134 "Run socat to test a loopback vsock in a local ns successfully connects to a vsock in the same ns."
137 "Run vsock_test client in a local ns with server in VM in same ns."
140 "Run vsock_test client in VM in a local ns with server in same ns."
188 echo "$*" >&2
196 arg=$2
213 ip netns add "global-parent" 2>/dev/null
216 ip netns add "local-parent" 2>/dev/null
221 ip netns add "global0" 2>/dev/null
223 ip netns add "global1" 2>/dev/null
225 ip netns add "local0" 2>/dev/null
227 ip netns add "local1" 2>/dev/null
242 log_host "removed ns ${mode}0"
243 log_host "removed ns ${mode}1"
283 echo "${arg} is not an available test" >&2
290 echo "Test ${arg} not found" >&2
314 # If the test requires NS support, check if NS support exists
315 # using /proc/self/ns
317 [[ ! -e /proc/self/ns ]]; then
318 log_host "No NS support detected for test ${tname}"
342 printf "warning: vng version '%s' has not been tested and may " "${version}" >&2
343 printf "not function properly.\n\tThe following versions have been tested: " >&2
344 echo "${tested_versions[@]}" >&2
368 echo "-b requires vmtest.sh called from the kernel source tree" >&2
399 pkill -SIGTERM -F "${pidfile}" > /dev/null 2>&1
420 local ns=$2
446 if [[ "${ns}" != "init_ns" ]]; then
447 ns_exec="ip netns exec ${ns}"
465 local ns=$1
474 if vm_ssh "${ns}" -- true; then
486 local interval=$2
510 echo "Unknown protocol: ${protocol}" >&2
519 local ns=$1
520 local port=$2
523 vm_ssh "${ns}" <<EOF
530 local ns=$1
531 local port=$2
534 if [[ "${ns}" == "init_ns" ]]; then
537 ip netns exec "${ns}" bash <<-EOF
545 local ns=$1
547 vm_ssh "${ns}" -- dmesg 2>/dev/null | grep -c -i 'Oops'
551 local ns=$1
553 vm_ssh "${ns}" -- dmesg --level=warn 2>/dev/null | grep -c -i 'vsock'
558 local ns=$2
563 oops_after=$(vm_dmesg_oops_count "${ns}")
565 echo "FAIL: kernel oops detected on vm in ns ${ns}" | log_host
569 warn_after=$(vm_dmesg_warn_count "${ns}")
571 echo "FAIL: kernel warning detected on vm in ns ${ns}" | log_host
579 local ns=$1
580 local host=$2
588 vm_ssh "${ns}" -- "${VSOCK_TEST}" \
593 2>&1 | log_guest
596 vm_ssh "${ns}" -- "${VSOCK_TEST}" \
600 2>&1 | log_guest &
608 vm_wait_for_listener "${ns}" "${port}" "tcp"
617 local ns=$1
618 local host=$2
626 if [[ "${ns}" != "init_ns" ]]; then
627 cmd="ip netns exec ${ns} ${cmd}"
638 "${extra_args[@]}" 2>&1 | log_host
645 "${extra_args[@]}" 2>&1 | log_host &
653 host_wait_for_listener "${ns}" "${port}" "tcp"
697 local ns=$1
699 ip netns exec "${ns}" cat /proc/sys/net/vsock/ns_mode 2>/dev/null
751 vm_vsock_test "${ns0}" "server" 2 "${TEST_GUEST_PORT}"
785 log_host "failed to start vm (cid=${VSOCK_CID}, ns=${ns0})"
796 socat STDIN VSOCK-CONNECT:"${VSOCK_CID}":"${port}" 2>/dev/null
827 log_host "Setup socat bridge from ns ${ns0} to ns ${ns1} over port ${port}"
841 log_host "Launching ${VSOCK_TEST} in ns ${ns1}"
846 log_host "failed to start vm (cid=${cid}, ns=${ns0})"
857 vm_vsock_test "${ns0}" "10.0.2.2" 2 "${port}"
887 log_host "Launching socat in ns ${ns1}"
896 log_host "failed to start vm (cid=${cid}, ns=${ns0})"
908 bash -c "echo TEST | socat STDIN VSOCK-CONNECT:2:${port}" 2>&1 | log_guest
942 log_host "failed to start vm (cid=${cid}, ns=${ns0})"
954 socat STDIN VSOCK-CONNECT:"${VSOCK_CID}":"${port}" 2>/dev/null
983 log_host "Launching socat in ns ${ns1}"
991 log_host "failed to start vm (cid=${cid}, ns=${ns0})"
1001 bash -c "echo TEST | socat STDIN VSOCK-CONNECT:2:${port}" 2>&1 | log_guest
1021 local ns1=$2
1028 log_host "Launching socat in ns ${ns1}"
1031 ip netns exec "${ns1}" socat VSOCK-LISTEN:"${port}" STDOUT > "${outfile}" 2>/dev/null &
1035 log_host "Launching socat in ns ${ns0}"
1036 echo TEST | ip netns exec "${ns0}" socat STDIN VSOCK-CONNECT:1:"${port}" 2>/dev/null
1101 local ns="local0"
1111 if ! vm_start "${pidfile}" "${ns}"; then
1115 vm_wait_for_ssh "${ns}"
1116 oops_before=$(vm_dmesg_oops_count "${ns}")
1117 warn_before=$(vm_dmesg_warn_count "${ns}")
1119 vm_vsock_test "${ns}" "server" 2 "${TEST_GUEST_PORT}"
1127 host_vsock_test "${ns}" "127.0.0.1" "${VSOCK_CID}" "${TEST_HOST_PORT}" --skip=29
1130 vm_dmesg_check "${pidfile}" "${ns}" "${oops_before}" "${warn_before}"
1144 local ns="local0"
1154 if ! vm_start "${pidfile}" "${ns}"; then
1158 vm_wait_for_ssh "${ns}"
1159 oops_before=$(vm_dmesg_oops_count "${ns}")
1160 warn_before=$(vm_dmesg_warn_count "${ns}")
1162 host_vsock_test "${ns}" "server" "${VSOCK_CID}" "${port}"
1163 vm_vsock_test "${ns}" "10.0.2.2" 2 "${port}"
1166 vm_dmesg_check "${pidfile}" "${ns}" "${oops_before}" "${warn_before}"
1180 local ns1=$2
1244 local ns="${mode}0"
1246 if echo "${mode}" 2>/dev/null > /proc/sys/net/vsock/ns_mode; then
1252 if ! echo "${mode}" | ip netns exec "${ns}" \
1263 if ! vm_vsock_test "init_ns" "server" 2 "${TEST_GUEST_PORT}"; then
1279 if ! vm_vsock_test "init_ns" "10.0.2.2" 2 "${TEST_HOST_PORT_LISTENER}"; then
1321 socat VSOCK-LISTEN:"${port}",fork STDOUT > "${outfile}" 2>/dev/null &
1481 host_oops_before=$(dmesg 2>/dev/null | grep -c -i 'Oops')
1482 host_warn_before=$(dmesg --level=warn 2>/dev/null | grep -c -i 'vsock')
1486 host_oops_after=$(dmesg 2>/dev/null | grep -c -i 'Oops')
1494 host_warn_after=$(dmesg --level=warn 2>/dev/null | grep -c -i 'vsock')