forked from coreos/ignition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_blackbox_tests
executable file
·29 lines (22 loc) · 989 Bytes
/
build_blackbox_tests
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
#!/usr/bin/env bash
set -eu
# Use the stubs, not the system user{mod,add} binaries. Since we don't know how exactly the bb
# tests will be run and where the stubs will be located, rely on the bb test caller setting up
# their PATH to include them. We don't need to include `id` because it gets copied into the
# system
GLDFLAGS="-X github.com/coreos/ignition/v2/internal/distro.useraddCmd=useradd-stub "
GLDFLAGS+="-X github.com/coreos/ignition/v2/internal/distro.usermodCmd=usermod-stub "
GLDFLAGS+="-X github.com/coreos/ignition/v2/internal/distro.userdelCmd=userdel-stub "
GLDFLAGS+="-X github.com/coreos/ignition/v2/internal/distro.groupdelCmd=groupdel-stub "
GLDFLAGS+="-X github.com/coreos/ignition/v2/internal/distro.blackboxTesting=true "
. ./build
PKG=$(go list ./tests/)
echo "Compiling tests..."
go test -c $PKG
for D in tests/stubs/*; do
if [ -d "${D}" ]; then
echo "Building ${D}"
go build -o ${BIN_PATH}/$(basename ${D}) ${REPO_PATH}/${D}
fi
done
echo "Success"