File: 00echo.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 (30 lines) | stat: -rwxr-xr-x 650 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
28
29
30
#!/bin/sh

# all paths need to be relative to $srcdir variable
srcdir=${srcdir:-.}

# include common script
. $srcdir/common.inc.sh

# do not run tests if is not called as root
is_root || skip_all "not root"

# prepare tests. how many tests will be?
prepare 1

# general testing rule:
#     do_something
#     check_if_it_is_ok || not
#     ok "message"

echo=${ECHO:-/bin/echo}

# echo something
t=`$srcdir/chroot.sh $testtree $echo something 2>&1`
# check if it is ok or print "not"
test "$t" = "something" || not
# print "ok" message with unquoted test output
ok "chroot echo:" $t

# clean up temporary directory after tests and end tests
cleanup