tools/testing/selftests/net/cmsg_time.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/cmsg_time.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/cmsg_time.sh- Extension
.sh- Size
- 2275 bytes
- Lines
- 103
- 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
source lib.sh
IP4=172.16.0.1/24
TGT4=172.16.0.2
IP6=2001:db8:1::1/64
TGT6=2001:db8:1::2
cleanup()
{
cleanup_ns $NS
}
trap cleanup EXIT
# Namespaces
setup_ns NS
ip netns exec $NS sysctl -w net.ipv4.ping_group_range='0 2147483647' > /dev/null
# Connectivity
ip -netns $NS link add type dummy
ip -netns $NS link set dev dummy0 up
ip -netns $NS addr add $IP4 dev dummy0
ip -netns $NS addr add $IP6 dev dummy0
# Need FQ for TXTIME
ip netns exec $NS tc qdisc replace dev dummy0 root fq
# Test
BAD=0
TOTAL=0
check_result() {
local ret=$1
local got=$2
local exp=$3
local case=$4
local xfail=$5
local xf=
local inc=
if [ "$xfail" == "xfail" ]; then
xf="(XFAIL)"
inc=0
else
inc=1
fi
((TOTAL++))
if [ $ret -ne 0 ]; then
echo " Case $case returned $ret, expected 0 $xf"
((BAD+=inc))
elif [ "$2" != "$3" ]; then
echo " Case $case returned '$got', expected '$exp' $xf"
((BAD+=inc))
fi
}
for i in "-4 $TGT4" "-6 $TGT6"; do
for p in u i r; do
[ $p == "u" ] && prot=UDPv${i:1:2}
[ $p == "i" ] && prot=ICMPv${i:1:2}
[ $p == "r" ] && prot=RAWv${i:1:2}
ts=$(ip netns exec $NS ./cmsg_sender -p $p $i 1234)
check_result $? "$ts" "" "$prot - no options"
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.