-
Notifications
You must be signed in to change notification settings - Fork 2
/
runtests.sh
83 lines (70 loc) · 1.57 KB
/
runtests.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
#
# Test NetX API calls against a test server. Run these tests against a newly
# upgraded NetX test server to ensure the new NetX version is working as
# expected for this module.
#
# Example: ./runtests.sh -u USERNAME -p PASSWORD -s http://example.com
#
usage()
{
cat <<EOF
Test NetX API calls against a test server. Run these tests against a newly
upgraded NetX test server to ensure the new NetX version is working as
expected for this module.
Usage: $0 [-h] [-u <username>] [-p <password>] [-s <url>] [-a <assets_per_page>]
-h
Print usage.
-u <username>
NetX username.
-p <password>
NetX password.
-s <url>
NetX server URL.
-a <assets_per_page>
Assets per page (optional).
EOF
}
while getopts ":u:p:s:a:" opt
do
case "$opt" in
h)
usage
exit 0
;;
u)
username=${OPTARG}
;;
p)
password=${OPTARG}
;;
s)
url=${OPTARG}
;;
a)
assets_per_page=${OPTARG}
;;
?)
usage >& 2
exit 1
;;
esac
done
if [ -z ${username} ] || [ -z ${password} ] || [ -z ${url} ]
then
usage
exit 1
fi
if [ -z ${assets_per_page} ]
then
assets_per_page=10
fi
echo "username = ${username}"
echo "password = ${password}"
echo "url = ${url}"
echo "assets_per_page = ${assets_per_page}"
export NETX_USERNAME="${username}"
export NETX_PASSWORD="${password}"
export NETX_URL="${url}"
export ASSETS_PER_PAGE="${assets_per_page}"
python -m unittest tests.test_netx