-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
142 lines (107 loc) · 4.33 KB
/
README
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
NETCONF and YANG Automation (NYAT) setup
=========================================
Build a docker image with NSO and DrNED Examiner installed for performing
NETCONF and YANG Automation testing of your devices.
NSO eval:
https://developer.cisco.com/docs/nso/getting-and-installing-nso/#getting-nso
DrNED Examiner (downloaded by the Dockerfile):
https://github.com/NSO-developer/drned-xmnr
The NETCONF and YANG Automation Testing Guide:
https://info.tail-f.com/netconf_yang_automation_testing
Prerequisites
-------------
NSO and DrNED Examiner in Docker runs on:
- Linux
- Mac OS X
To build these images, you need:
- Docker
- Make
Install with:
Debian: apt install coreutils make
Mac OS X: brew install coreutils
see https://docs.docker.com/get-docker/ for installation instructions for Docker
Usage
-----
The ideal scenario would be to deliver prebuilt Docker images containing NSO
but as legal requirements prevent that, this is the second best option. This
repository contains recipes that you can use to produce Docker images yourself.
Just add Cisco NSO.
Building
--------
Manually building Docker images on your local machine
1. Clone this repository to your local machine
git clone https://github.com/ConfD-Developer/nso-drned-xmnr-docker.git
2. Download Cisco NSO
go to https://developer.cisco.com/docs/nso/#!getting-nso/getting-nso
and click the “NSO 5.x Linux” link to download NSO
If the file ends with .signed.bin, it is a self-extracting archive
that verifies a signature, execute it to produce the installer
for example running bash nso-5.4.linux.x86_64.signed.bin will produce
a number of files, among them the install nso-5.4.linux.x86_64.installer.bin
3. Place the nso-5.x.linux.x86_64.installer.bin file in the top-level folder of
this repository
4. run ./setup.sh in the root directory of the repository, which will build a
Docker image out of all the NSO install files found
NOTE: running docker commands, which are invoked by the setup script,
typically require root privileges or membership in the docker group.
Update NSO_VERSION to match the version of NSO you have downloaded.
The default is 5.5.
The completion of the docker build should look like as follows:
Step 12/18 : WORKDIR /ncs-run
---> Running in cc3bb7aa1e48
Removing intermediate container cc3bb7aa1e48
---> 66f6dea51b72
Step 13/18 : ADD Makefile /ncs-run
---> 9d4afcaef0b5
Step 14/18 : ADD add_device.py /ncs-run
---> 9dd51f4c1a05
Step 15/18 : WORKDIR /nso
---> Running in dafc0856058b
Removing intermediate container dafc0856058b
---> 02c57d8f096f
Step 16/18 : ADD run.sh /nso
---> d87dbad0217a
Step 17/18 : EXPOSE 22 2022 2024 8080 8888
---> Running in 56a8b1962891
Removing intermediate container 56a8b1962891
---> c28bfc6644ae
Step 18/18 : CMD [ "./run.sh" ]
---> Running in e688f3c32eac
Removing intermediate container e688f3c32eac
---> c873c3adb1c6
Successfully built c873c3adb1c6
Successfully tagged nso-drned-xmnr:latest
5. You can also optionally verify that docker image has been built with the
following command:
$ docker images -a | grep nso-drned-xmnr
nso-drned-xmnr latest b15e3f7a9aba 28 minutes ago 1.82GB
Running
-------
An example docker run command:
docker run -it -p 2222:22 -e DOCKPWD=root-password nso-drned-xmnr:latest
Exposed ports
Protocol Port Use
TCP 22 SSH
TCP 8080 HTTP
TCP 8888 HTTPS
TCP 2022 NSO NETCONF Northbound
TCP 2024 ncs_cli
NSO is installed at /nso
NSO project has been set up at /ncs-run
You should first source /nso/ncsrc before running any other NSO tools.
In addition to the console shell, you can login to the container (with root-password) by:
ssh -p 2222 root@localhost
To copy log files to your local host (command to be issued on your localhost):
scp -P 2222 root@localhost:/ncs-run/logs/ncs-python-vm-drned-xmnr.log .
NETCONF and YANG Automation Testing
-----------------------------------
NETCONF and YANG Automation Testing User Guide v3 can be found at:
https://info.tail-f.com/netconf_yang_automation_testing
Jump to Section 4 of NYAT User Guide and perform the following steps
before continuing with your NYAT journey:
$ source /nso/ncsrc
$ cd /ncs-run
$ ncs_cli -Cu admin
admin@ncs#
You can also use the automation scripts to reduce some typing for you
as described in Section 7 of the NYAT User Guide v4.