tools/testing/selftests/net/ppp/ppp_common.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/ppp/ppp_common.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/ppp/ppp_common.sh- Extension
.sh- Size
- 876 bytes
- Lines
- 46
- 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
# shellcheck disable=SC2153
source ../lib.sh
IP_SERVER="192.168.200.1"
IP_CLIENT="192.168.200.2"
ppp_common_init() {
# Package requirements
require_command socat
require_command pppd
require_command iperf3
# Check for root privileges
if [ "$(id -u)" -ne 0 ];then
echo "SKIP: Need root privileges"
exit "$ksft_skip"
fi
# Namespaces
setup_ns NS_SERVER NS_CLIENT
}
ppp_check_addr() {
dev=$1
addr=$2
ns=$3
ip -netns "$ns" -4 addr show dev "$dev" 2>/dev/null | grep -q "$addr"
return $?
}
ppp_test_connectivity() {
slowwait 10 ppp_check_addr "ppp0" "$IP_CLIENT" "$NS_CLIENT"
ip netns exec "$NS_CLIENT" ping -c 3 "$IP_SERVER"
check_err $?
ip netns exec "$NS_SERVER" iperf3 -s -1 -D
wait_local_port_listen "$NS_SERVER" 5201 tcp
ip netns exec "$NS_CLIENT" iperf3 -c "$IP_SERVER" -Z -t 2
check_err $?
}
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.