tools/testing/selftests/net/netns-sysctl.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/netns-sysctl.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/netns-sysctl.sh- Extension
.sh- Size
- 910 bytes
- Lines
- 41
- 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
function fail
Annotated Snippet
#!/bin/bash -e
# SPDX-License-Identifier: GPL-2.0
#
# This test checks that the network buffer sysctls are present
# in a network namespaces, and that they are readonly.
source lib.sh
cleanup() {
cleanup_ns $test_ns
}
trap cleanup EXIT
fail() {
echo "ERROR: $*" >&2
exit 1
}
setup_ns test_ns
for sc in {r,w}mem_{default,max}; do
# check that this is writable in a netns
[ -w "/proc/sys/net/core/$sc" ] ||
fail "$sc isn't writable in the init netns!"
# change the value in the host netns
sysctl -qw "net.core.$sc=300000" ||
fail "Can't write $sc in init netns!"
# check that the value is read from the init netns
[ "$(ip netns exec $test_ns sysctl -n "net.core.$sc")" -eq 300000 ] ||
fail "Value for $sc mismatch!"
# check that this isn't writable in a netns
ip netns exec $test_ns [ -w "/proc/sys/net/core/$sc" ] &&
fail "$sc is writable in a netns!"
done
echo 'Test passed OK'
Annotation
- Detected declarations: `function fail`.
- 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.