tools/testing/selftests/net/traceroute.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/traceroute.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/traceroute.sh- Extension
.sh- Size
- 22679 bytes
- Lines
- 782
- 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
#
# Run traceroute/traceroute6 tests
#
source lib.sh
VERBOSE=0
PAUSE_ON_FAIL=no
################################################################################
#
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
}
__check_traceroute_version()
{
local cmd=$1; shift
local req_ver=$1; shift
local ver
req_ver=$(echo "$req_ver" | sed 's/\.//g')
ver=$($cmd -V 2>&1 | grep -Eo '[0-9]+.[0-9]+.[0-9]+' | sed 's/\.//g')
if [[ $ver -lt $req_ver ]]; then
return 1
else
return 0
fi
}
check_traceroute6_version()
{
local req_ver=$1; shift
__check_traceroute_version traceroute6 "$req_ver"
}
check_traceroute_version()
{
local req_ver=$1; shift
__check_traceroute_version traceroute "$req_ver"
}
################################################################################
# create namespaces and interconnects
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.