Skip to content

Commit abfe971

Browse files
Add Integtest.sh for OpenSearch integtest setups (#31)
* Add integTest script to the repo Signed-off-by: Peter Zhu <[email protected]> * Remove GitHub Actions Specific Yarn code Signed-off-by: Peter Zhu <[email protected]> * Add bootstrp step Signed-off-by: Peter Zhu <[email protected]>
1 parent 6ab1df2 commit abfe971

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

Diff for: integtest.sh

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
function usage() {
6+
echo ""
7+
echo "This script is used to run integration tests for plugin installed on a remote OpenSearch/Dashboards cluster."
8+
echo "--------------------------------------------------------------------------"
9+
echo "Usage: $0 [args]"
10+
echo ""
11+
echo "Required arguments:"
12+
echo "None"
13+
echo ""
14+
echo "Optional arguments:"
15+
echo -e "-b BIND_ADDRESS\t, defaults to localhost | 127.0.0.1, can be changed to any IP or domain name for the cluster location."
16+
echo -e "-p BIND_PORT\t, defaults to 9200 or 5601 depends on OpenSearch or Dashboards, can be changed to any port for the cluster location."
17+
echo -e "-s SECURITY_ENABLED\t(true | false), defaults to true. Specify the OpenSearch/Dashboards have security enabled or not."
18+
echo -e "-c CREDENTIAL\t(usename:password), no defaults, effective when SECURITY_ENABLED=true."
19+
echo -e "-h\tPrint this message."
20+
echo "--------------------------------------------------------------------------"
21+
}
22+
23+
while getopts ":hb:p:s:c:" arg; do
24+
case $arg in
25+
h)
26+
usage
27+
exit 1
28+
;;
29+
b)
30+
BIND_ADDRESS=$OPTARG
31+
;;
32+
p)
33+
BIND_PORT=$OPTARG
34+
;;
35+
s)
36+
SECURITY_ENABLED=$OPTARG
37+
;;
38+
c)
39+
CREDENTIAL=$OPTARG
40+
;;
41+
:)
42+
echo "-${OPTARG} requires an argument"
43+
usage
44+
exit 1
45+
;;
46+
?)
47+
echo "Invalid option: -${OPTARG}"
48+
exit 1
49+
;;
50+
esac
51+
done
52+
53+
54+
if [ -z "$BIND_ADDRESS" ]
55+
then
56+
BIND_ADDRESS="localhost"
57+
fi
58+
59+
if [ -z "$BIND_PORT" ]
60+
then
61+
BIND_PORT="5601"
62+
fi
63+
64+
if [ -z "$SECURITY_ENABLED" ]
65+
then
66+
SECURITY_ENABLED="true"
67+
fi
68+
69+
if [ -z "$CREDENTIAL" ]
70+
then
71+
CREDENTIAL="admin:admin"
72+
USERNAME=`echo $CREDENTIAL | awk -F ':' '{print $1}'`
73+
PASSWORD=`echo $CREDENTIAL | awk -F ':' '{print $2}'`
74+
fi
75+
76+
yarn osd bootstrap
77+
cypress run --env security_enabled=$SECURITY_ENABLED

0 commit comments

Comments
 (0)