forked from kubernetes-sigs/kubebuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_test.sh
executable file
·43 lines (35 loc) · 1.2 KB
/
install_test.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
source ./scripts/install.sh
echo "Start test"
if [ -z "$KUBEBUILDER_VERSION" ]; then
echo "\nUnable to fetch the latest version tag. Quit the test"
exit 0
fi
echo "1. Check whether $TMP_DIR folder is removed.\n"
if [ -d "$TMP_DIR" ]; then
echo "$TMP_DIR folder is not removed."
exit 1
fi
echo "passed\n"
echo "2. Check whether $KUBEBUILDER_DIR folder exists.\n"
if [ ! -d "$KUBEBUILDER_DIR" ]; then
echo "$KUBEBUILDER_DIR folder is not existed."
exit 1
fi
echo "passed\n"
echo "3. Check whether kubebuilder is installed properly.\n"
if [ ! -x "$KUBEBUILDER_DIR/bin/kubebuilder" ]; then
echo "$KUBEBUILDER_DIR/bin/kubebuilder is not existed or execute permission not granted."
exit 1
fi
echo "passed\n"
echo "4. Check whether kubebuilder version is same as installed.\n"
KUBEBUILDER_VERSION_FROM_BIN=$($KUBEBUILDER_DIR/bin/kubebuilder version | \
sed 's/^.*KubeBuilderVersion:"\(.*\)", KubernetesVendor.*$/\1/')
if [ ! "${KUBEBUILDER_VERSION_FROM_BIN}" = "${KUBEBUILDER_VERSION}" ]; then
echo "kubebuilder version ${KUBEBUILDER_VERSION_FROM_BIN} mismatched from the version installed (${KUBEBUILDER_VERSION})"
exit 1
fi
echo "passed\n"
echo "install test done successfully\n"
exit 0