forked from jheidbrink/magma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe2e_test_setup.sh
executable file
·47 lines (37 loc) · 1.52 KB
/
e2e_test_setup.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
#!/usr/bin/env bash
#
# Copyright 2020 The Magma Authors.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
mkdir -p .cache
mkdir -p /tmp/nms_artifacts
openssl req -nodes -new -x509 -batch -keyout .cache/mock_server.key -out .cache/mock_server.cert -subj "/"
docker-compose --env-file .env.mock -f docker-compose-e2e.yml up -d
i=0
while [ $i -lt 60 ]
do
val=$(docker-compose -f docker-compose-e2e.yml logs magmalte 2>&1 | grep 'Production server started on port 8081' | wc -l)
if [ $val -eq 1 ]
then
break
fi
echo "magmalte server not started yet...sleeping 1 second"
sleep 1
i=$[$i+1]
done
docker-compose exec -T magmalte yarn setAdminPassword magma-test [email protected] password1234
docker-compose exec -T magmalte yarn createOrganization magma-test test,test_feg_lte_network
# run the end to end test
set +e
yarn test:e2e
exit_code=$?
docker-compose -f docker-compose-e2e.yml logs magmalte &> /tmp/nms_artifacts/magmalte.log
docker-compose -f docker-compose-e2e.yml logs mock_server &> /tmp/nms_artifacts/mock_server.log
docker-compose -f docker-compose-e2e.yml --env-file .env.mock down
exit $exit_code