File: TESTING.md

package info (click to toggle)
netmiko 2.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 856 kB
  • sloc: python: 6,533; makefile: 4
file content (46 lines) | stat: -rw-r--r-- 997 bytes parent folder | download | duplicates (2)
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
# Testing

This document covers the test suite for Netmiko.

## The simple version

```
cd ./netmiko/tests/etc  
cp test_devices.yml.example test_devices.yml  
cp responses.yml.example responses.yml  
cp commands.yml.example commands.yml  
```

#### edit test_devices.yml

Pick the device_types you want to test against; update:
* ip 
* username
* password
* secret (optional)

#### edit responses.yml

For the device_types that you are testing against, update the following to match the test 
device(s):  
* the base_prompt
* router_prompt
* enable_prompt
* interface_ip

#### Execute the test
```
cd ./netmiko/tests
```

Note, the test_device is the name of the device from test_devices.yml and responses.yml:  
```
py.test -v test_netmiko_show.py --test_device cisco881  
py.test -v test_netmiko_config.py --test_device cisco881
```

There are three tests available:  
* test_netmiko_show.py  
* test_netmiko_config.py  
* test_netmiko_commit.py      # currently only for Juniper and IOS-XR