File: 10mock-server.t

package info (click to toggle)
libnss-docker 0.02-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,676 kB
  • sloc: sh: 4,557; ansic: 320; makefile: 63
file content (27 lines) | stat: -rwxr-xr-x 702 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

srcdir=${srcdir:-.}
. $srcdir/common.inc.sh

abs_srcdir=${abs_srcdir:-`cd "$pwd" 2>/dev/null && pwd -P`}

is_root || skip_all "not root"

prepare 2

$srcdir/chroot.sh $testtree /bin/test-docker-api-server 1 /tmp/sock test 1.2.3.4 >$testtree/mock-server.log 2>&1 &
server_pid=$!

sleep 3
test -S "$testtree/tmp/sock" || not
ok "chroot /tmp/sock socket created" `cat $testtree/mock-server.log 2>&1`

t=`$srcdir/chroot.sh $testtree /bin/test-docker-api-client /tmp/sock 1.19 test 2>&1`
test "$t" != "${t#HTTP/1.0 200 OK}" || not
ok "chroot docker api mock server returns" `echo $t | tr -c '[:print:]' ' '`

pkill -f test-docker-api-server || true

test -d "$tmpdir" && rmdir "$tmpdir"

cleanup