fuzzing: fix fuzz_stable_sort_r_unstable comparison
[Samba.git] / selftest / ns / nsenter-helper.sh
blob4242227eaaeddfe3f5e79c872b158b9eb5f3a7fd
1 #!/bin/sh
3 # Helper script that gets run with nsenter to manually setup a secondary shell
4 # session to a given namespace testenv. This basically just sets up the same
5 # environment variables as you normally get with selftest, for convenience.
7 if [ $# -lt 1 ]; then
8 echo "Usage: $0 <exports-file>"
9 exit 1
12 # we get passed a exports file with all the environment variables defined
13 exports_file=$1
15 # read the exports file so the new shell has appropriate variables setup
16 # (we export rather than sourcing here so they get inherited by the subshell)
17 while read -r line; do
18 export $line
19 # dump them for the user too
20 echo $line
21 done <$exports_file
23 echo ""
24 echo "Entered $NETBIOSNAME namespace, with above variables defined."
25 echo "Use CTRL+D or exit to leave the namespace."
26 echo ""
28 # start a shell session in the new namespace
29 $SHELL