tools/testing/selftests/net/l2tp.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/l2tp.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/l2tp.sh- Extension
.sh- Size
- 9910 bytes
- Lines
- 377
- 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
#
# L2TPv3 tunnel between 2 hosts
#
# host-1 | router | host-2
# | |
# lo l2tp | | l2tp lo
# 172.16.101.1 172.16.1.1 | | 172.16.1.2 172.16.101.2
# fc00:101::1 fc00:1::1 | | fc00:1::2 fc00:101::2
# | |
# eth0 | | eth0
# 10.1.1.1 | | 10.1.2.1
# 2001:db8:1::1 | | 2001:db8:2::1
source lib.sh
VERBOSE=0
PAUSE_ON_FAIL=no
which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
################################################################################
#
log_test()
{
local rc=$1
local expected=$2
local msg="$3"
if [ ${rc} -eq ${expected} ]; then
printf "TEST: %-60s [ OK ]\n" "${msg}"
nsuccess=$((nsuccess+1))
else
ret=1
nfail=$((nfail+1))
printf "TEST: %-60s [FAIL]\n" "${msg}"
if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
echo
echo "hit enter to continue, 'q' to quit"
read a
[ "$a" = "q" ] && exit 1
fi
fi
}
run_cmd()
{
local ns
local cmd
local out
local rc
ns="$1"
shift
cmd="$*"
if [ "$VERBOSE" = "1" ]; then
printf " COMMAND: $cmd\n"
fi
out=$(eval ip netns exec ${ns} ${cmd} 2>&1)
rc=$?
if [ "$VERBOSE" = "1" -a -n "$out" ]; then
echo " $out"
fi
[ "$VERBOSE" = "1" ] && echo
return $rc
}
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.