Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,12 @@ pts_json
pts.json

# diff files
diff_*
diff_*

# labs created by workshop
disaster/
learnt/
diff/
initial_output/
current_output/
parser_diff/
30 changes: 17 additions & 13 deletions mocked_devices/disaster_yamls/csr/csr1000v-1.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
execute:
commands:
"config term":
config term:
new_state: config
"term length 0": ""
"term width 511": ""
"term width 0": ""
"terminal session-timeout 0": ""
term length 0: ""
term width 511: ""
term width 0: ""
terminal session-timeout 0: ""
service result: ""
no logging console: ""
dir: "Directory of bootflash:/\r\n\r\n 11 drwx 16384 Jul 18 2018\
\ 07:49:17 +00:00 lost+found\r\n325121 drwx 4096 Jan 18 2019\
\ 20:42:46 +00:00 .installer\r\n 12 -rw- 392479704 Jul 18 2018 07:50:04\
Expand Down Expand Up @@ -283,8 +285,8 @@ execute:
\n\r\n% dampening not enabled for base\r\n\r\nFor address family: MVPNv4 Unicast\r\
\n\r\n% dampening not enabled for base\r\n\r\nFor address family: MVPNv6 Unicast\r\
\n\r\n% dampening not enabled for base"
'show ip bgp template peer-policy ': No templates configured
'show ip bgp template peer-session ': No templates configured
show ip bgp template peer-policy: No templates configured
show ip bgp template peer-session: No templates configured
show ip igmp groups detail: "\r\nFlags: L - Local, U - User, SG - Static Group,\
\ VG - Virtual Group,\r\n SS - Static Source, VS - Virtual Source,\r\n\
\ Ac - Group accounted towards access control limit"
Expand Down Expand Up @@ -848,16 +850,18 @@ execute:
\ hard disk at bootflash:.\r\n0K bytes of WebUI ODM Files at webui:.\r\n\r\n\
Configuration register is 0x2102"
show vlan: "show vlan\r\n% Incomplete command."
show version | include operating mode: ""
show vrf detail: ''
show vrf detail | inc \(VRF: ''
prompt: switch#
prompt: "csr1000v-1#"

config:
prompt: "csr1000v-1(config)#"
commands:
"no logging console": ""
"line console 0": ""
"exec-timeout 0": ""
"terminal width 511": ""
"end":
no logging console: ""
line console 0: ""
line vty 0 4: ""
exec-timeout 0: ""
terminal width 511: ""
end:
new_state: execute
27 changes: 16 additions & 11 deletions mocked_devices/disaster_yamls/nxos/nx-osv-1.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
execute:
commands:
"term length 0": ""
"term width 511": ""
"term width 0": ""
"terminal session-timeout 0": ""
"config term":
term length 0: ""
term width 511: ""
term width 0: ""
terminal session-timeout 0: ""
service result: ""
no logging console: ""
line vty: ""
config term:
new_state: config
dir: " 4096 Feb 25 20:49:04 2016 .patch/\r\n 16384 Feb 25 20:44:49\
\ 2016 lost+found/\r\n 4096 Feb 26 10:11:16 2016 scripts/\r\n 33615360\
Expand Down Expand Up @@ -4856,14 +4859,16 @@ execute:
\ 1 --\r\nEthernet3/48 default \
\ 1 --\r\nmgmt0 management \
\ 2 --"
prompt: switch#
prompt: "nx-osv-1#"

config:
prompt: "nx-osv-1(config)#"
commands:
"no logging console": ""
"line console": ""
"exec-timeout 0": ""
"terminal width 511": ""
"end":
no logging console: ""
line console: ""
line vty: ""
exec-timeout 0: ""
terminal width 511: ""
service result: ""
end:
new_state: execute
34 changes: 20 additions & 14 deletions mocked_devices/initial_yamls/csr/csr1000v-1.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
execute:
commands:
"config term":
config term:
new_state: config
"term length 0": ""
"term width 511": ""
"term width 0": ""
"terminal session-timeout 0": ""
term length 0: ""
term width 511: ""
term width 0: ""
terminal session-timeout 0: ""
service result: ""
no logging console: ""
dir: "Directory of bootflash:/\r\n\r\n 11 drwx 16384 Jul 18 2018\
\ 07:49:17 +00:00 lost+found\r\n325121 drwx 4096 Jan 18 2019\
\ 20:42:46 +00:00 .installer\r\n 12 -rw- 392479704 Jul 18 2018 07:50:04\
Expand Down Expand Up @@ -283,8 +285,8 @@ execute:
\n\r\n% dampening not enabled for base\r\n\r\nFor address family: MVPNv4 Unicast\r\
\n\r\n% dampening not enabled for base\r\n\r\nFor address family: MVPNv6 Unicast\r\
\n\r\n% dampening not enabled for base"
'show ip bgp template peer-policy ': No templates configured
'show ip bgp template peer-session ': No templates configured
show ip bgp template peer-policy: "No templates configured"
show ip bgp template peer-session: "No templates configured"
show ip igmp groups detail: "\r\nFlags: L - Local, U - User, SG - Static Group,\
\ VG - Virtual Group,\r\n SS - Static Source, VS - Virtual Source,\r\n\
\ Ac - Group accounted towards access control limit"
Expand Down Expand Up @@ -884,16 +886,20 @@ execute:
\ hard disk at bootflash:.\r\n0K bytes of WebUI ODM Files at webui:.\r\n\r\n\
Configuration register is 0x2102"
show vlan: "show vlan\r\n% Incomplete command."
show vrf detail: ''
show version | include operating mode: ""
show install summary: ""
show vrf: ""
show vrf detail: ""
show vrf detail | inc \(VRF: ''
prompt: switch#
prompt: "csr1000v-1#"

config:
prompt: "csr1000v-1(config)#"
commands:
"no logging console": ""
"line console 0": ""
"exec-timeout 0": ""
"terminal width 511": ""
"end":
no logging console: ""
line console 0: ""
line vty 0 4: ""
exec-timeout 0: ""
terminal width 511: ""
end:
new_state: execute
31 changes: 20 additions & 11 deletions mocked_devices/initial_yamls/nxos/nx-osv-1.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
execute:
commands:
"term length 0": ""
"term width 511": ""
"term width 0": ""
"terminal session-timeout 0": ""
"config term":
term length 0: ""
term width 511: ""
term width 0: ""
terminal session-timeout 0: ""
service result: ""
no logging console: ""
line vty: ""
config term:
new_state: config
dir: " 4096 Feb 25 20:49:04 2016 .patch/\r\n 16384 Feb 25 20:44:49\
\ 2016 lost+found/\r\n 4096 Feb 26 10:11:16 2016 scripts/\r\n 33615360\
Expand Down Expand Up @@ -4766,6 +4769,10 @@ execute:
\ -------------------------------------------"
show vlan id 1-3967 vn-segment: " ^\r\n% Invalid\
\ command at '^' marker."
show vrf all: "VRF-Name VRF-ID State Reason \
\ \r\ndefault 1 Up -- \
\ \r\nmanagement 2 Up \
\ --"
show vrf: "VRF-Name VRF-ID State Reason \
\ \r\ndefault 1 Up -- \
\ \r\nmanagement 2 Up \
Expand Down Expand Up @@ -4875,14 +4882,16 @@ execute:
\ 1 --\r\nEthernet3/48 default \
\ 1 --\r\nmgmt0 management \
\ 2 --"
prompt: switch#
prompt: "nx-osv-1#"

config:
prompt: "nx-osv-1(config)#"
commands:
"no logging console": ""
"line console": ""
"exec-timeout 0": ""
"terminal width 511": ""
"end":
no logging console: ""
line console: ""
line vty: ""
exec-timeout 0: ""
terminal width 511: ""
service result: ""
end:
new_state: execute
6 changes: 3 additions & 3 deletions robot_compare_snapshot.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

*** Settings ***
# Importing test libraries, resource files and variable files.
Library genie.libs.robot.GenieRobot
Library pyats.robot.pyATSRobot
Library genie.libs.robot.GenieRobot


*** Variables ***
Expand All @@ -23,7 +23,7 @@ Connect
connect to device "csr1000v-1"

Profile the devices
Profile the system for "bgp;config;interface;platform;ospf;arp;vrf;vlan" on devices "nx-osv-1;csr1000v-1" as "./new_snapshot"
Profile the system for "bgp;config;interface;platform;ospf;arp;vrf;vlan" on devices "nx-osv-1;csr1000v-1" as "./disaster_snapshot/snap"

Compare snapshots
Compare profile "./good_snapshot" with "./new_snapshot" on devices "nx-osv-1;csr1000v-1"
Compare profile "./good_snapshot/snap" with "./disaster_snapshot/snap" on devices "nx-osv-1;csr1000v-1"
4 changes: 2 additions & 2 deletions robot_initial_snapshot.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

*** Settings ***
# Importing test libraries, resource files and variable files.
Library genie.libs.robot.GenieRobot
Library pyats.robot.pyATSRobot
Library genie.libs.robot.GenieRobot


*** Variables ***
Expand All @@ -23,4 +23,4 @@ Connect
connect to device "csr1000v-1"

Profile the devices
Profile the system for "bgp;config;interface;platform;ospf;arp;vrf;vlan" on devices "nx-osv-1;csr1000v-1" as "./good_snapshot"
Profile the system for "bgp;config;interface;platform;ospf;arp;vrf;vlan" on devices "nx-osv-1;csr1000v-1" as "./good_snapshot/snap"
4 changes: 2 additions & 2 deletions workshop.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ disastrous state, under the `disaster` folder.
Now, perform a diff of the states before and after disaster occurance.

```bash
pyats diff learnt disaster
pyats diff learnt disaster --output diff
```

You can clearly see that the OSPF and interface operational state has changed.

With an editor, open the two files:
With an editor, open the two files under `diff` folder:

* `diff_interface_nxos_nx-osv-1_ops.txt`
* `diff_ospf_nxos_nx-osv-1_ops.txt`
Expand Down