tools/testing/selftests/net/ovpn/test.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/ovpn/test.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/ovpn/test.sh- Extension
.sh- Size
- 8859 bytes
- Lines
- 321
- 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 "start notification listener peer${p}" \
ovpn_setup_listener "${p}"
# starting all YNL listeners back-to-back can intermittently
# stall their startup so serialize launches a bit
sleep 0.5
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 "${MTU}"
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_basic_traffic() {
local p
local header1
local header2
local peer_ns
local raddr
local tcpdump_pid1
local tcpdump_pid2
local tcpdump_timeout="1.5s"
for p in $(seq 1 ${OVPN_NUM_PEERS}); do
# The first part of the data packet header consists of:
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.