Debian Codegraph @

tests/options

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 set -e
4
5 SOCKET_ACTIVATE=${SOCKET_ACTIVATE:-socket-activate}
6 PWD=$(pwdscip-shell system . . pwd.)
7 TEST_SOCKET=${PWD}/tests/sock-options
8 MODE=600
9 if [scip-shell system . . `[`. "$(unamescip-shell system . . uname. -s)" = GNU ]; then
10 # GNU/Hurd requires an explicit timeout
11 NETCAT_OPTIONS=-w1
12 else
13 NETCAT_OPTIONS=
14 fi
15
16 envscip-shell system . . env. -i -- "$SOCKET_ACTIVATE" "--unix:label=test-options,mode=${MODE}:${TEST_SOCKET}" -- true &
17 sleepscip-shell system . . sleep. 0.1
18 nc $NETCAT_OPTIONS -U "${TEST_SOCKET}"
19 sock_mode=$(statscip-shell system . . stat. -c '%a' "${TEST_SOCKET}")
20 if [scip-shell system . . `[`. "$sock_mode" != "$MODE" ]; then
21 echoscip-shell system . . echo. "Wrong mode ($sock_mode, expected $MODE) for ${TEST_SOCKET}"
22 lsscip-shell system . . ls. -l "${TEST_SOCKET}"
23 exit 1
24 fi