-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
73 lines (64 loc) · 2.03 KB
/
.gitlab-ci.yml
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
variables:
HTTP_ENABLE: "true"
HTTPS_ENABLE: "true"
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "admin"
image:
name: "nso:gitlabci"
entrypoint: [""]
before_script:
- source /opt/ncs/current/ncsrc
stages:
- Build
- Load Config to CML
- Check Connection
- Run NSO Pytest Tests
- Clean Up CML
Compile NSO Packages:
stage: Build
script:
- mkdir -p release
- make -C packages/config-dns/src clean all || exit 1
- make -C packages/config-ntp/src clean all || exit 1
- cp -af packages/* release/
artifacts:
paths:
- release/
Load Topology config:
stage: Load Config to CML
script:
- python3 cml/cml_load_topo.py --config cml/cml_2csr_topo.yaml
Check Connection:
stage: Check Connection
script:
- python3 cml/cml_ping_check.py
Test config-dns Package:
stage: Run NSO Pytest Tests
script:
- mkdir -p /nso/run/packages
- cp -af release/* /nso/run/packages
- ln -s /opt/ncs/current/packages/neds/cisco-ios-cli-3.8 /nso/run/packages/cisco-ios-cli
- /run-nso.sh > /dev/null 2>&1 &
- bash nso/check_nso_readiness.sh
- ncs_load -lm nso/ci_setup.xml -u admin
- ncs_load -lm nso/load_devices.xml -u admin
- echo "request devices fetch-ssh-host-keys" | ncs_cli -u admin
- echo "request devices sync-from" | ncs_cli -u admin
- cd test; python3 -m pytest -sv dryrun_tests/test_config_dns.py
Test config-ntp Package:
stage: Run NSO Pytest Tests
script:
- mkdir -p /nso/run/packages
- cp -af release/* /nso/run/packages
- ln -s /opt/ncs/current/packages/neds/cisco-ios-cli-3.8 /nso/run/packages/cisco-ios-cli
- /run-nso.sh > /dev/null 2>&1 &
- bash nso/check_nso_readiness.sh
- ncs_load -lm nso/ci_setup.xml -u admin
- ncs_load -lm nso/load_devices.xml -u admin
- echo "request devices fetch-ssh-host-keys" | ncs_cli -u admin
- echo "request devices sync-from" | ncs_cli -u admin
- cd test; python3 -m pytest -sv dryrun_tests/test_config_ntp.py
Clean Up CML:
stage: Clean Up CML
script:
- python3 cml/cml_stop_lab.py