tools/testing/selftests/net/ovpn/test-close-socket.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/ovpn/test-close-socket.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/ovpn/test-close-socket.sh- Extension
.sh- Size
- 1867 bytes
- Lines
- 86
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020-2025 OpenVPN, Inc.
#
# Author: Antonio Quartulli <antonio@openvpn.net>
#set -x
set -eE
source ./common.sh
ovpn_test_finished=0
ovpn_test_exit() {
ovpn_cleanup
modprobe -r ovpn || true
if [ "${ovpn_test_finished}" -eq 0 ]; then
ktap_print_totals
fi
}
ovpn_prepare_network() {
local p
local peer_ns
for p in $(seq 0 ${OVPN_NUM_PEERS}); do
ovpn_cmd_ok "create namespace peer${p}" ovpn_create_ns "${p}"
done
for p in $(seq 0 ${OVPN_NUM_PEERS}); do
ovpn_cmd_ok "configure peer${p} namespace" ovpn_setup_ns \
"${p}" 5.5.5.$((p + 1))/24
done
for p in $(seq 0 ${OVPN_NUM_PEERS}); do
ovpn_cmd_ok "register peer${p} in overlay" ovpn_add_peer "${p}"
done
for p in $(seq 1 ${OVPN_NUM_PEERS}); do
peer_ns="ovpn_peer${p}"
ovpn_cmd_ok "set peer0 timeout for peer ${p}" \
ip netns exec ovpn_peer0 ${OVPN_CLI} set_peer tun0 \
${p} 60 120
ovpn_cmd_ok "set peer${p} timeout for peer ${p}" \
ip netns exec "${peer_ns}" ${OVPN_CLI} set_peer \
tun${p} $((p + OVPN_ID_OFFSET)) 60 120
done
}
ovpn_run_ping_traffic() {
local p
for p in $(seq 1 ${OVPN_NUM_PEERS}); do
ovpn_cmd_ok "send ping traffic to peer ${p}" \
ip netns exec ovpn_peer0 ping -qfc 100 -w 3 \
5.5.5.$((p + 1))
done
}
ovpn_run_iperf() {
local iperf_pid
ovpn_run_bg iperf_pid ip netns exec ovpn_peer0 iperf3 -1 -s
sleep 1
ovpn_cmd_ok "run iperf throughput flow" \
ip netns exec ovpn_peer1 iperf3 -Z -t 3 -c 5.5.5.1
wait "${iperf_pid}" || return 1
}
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.