brocadesan 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/README +113 -0
  2. data/Rakefile +46 -0
  3. data/brocadesan.gemspec +14 -0
  4. data/lib/brocadesan.rb +8 -0
  5. data/lib/brocadesan/alias.rb +64 -0
  6. data/lib/brocadesan/config/brocade/san/switch_cmd_mapping.yml +116 -0
  7. data/lib/brocadesan/config/parser_mapping.yml +21 -0
  8. data/lib/brocadesan/device.rb +296 -0
  9. data/lib/brocadesan/monkey/string.rb +11 -0
  10. data/lib/brocadesan/provisioning.rb +894 -0
  11. data/lib/brocadesan/switch.rb +882 -0
  12. data/lib/brocadesan/wwn.rb +63 -0
  13. data/lib/brocadesan/zone.rb +60 -0
  14. data/lib/brocadesan/zone_configuration.rb +38 -0
  15. data/lib/meta_methods.rb +263 -0
  16. data/test/alias_test.rb +68 -0
  17. data/test/device_test.rb +203 -0
  18. data/test/output_helpers.rb +308 -0
  19. data/test/outputs/agshow_1.txt +7 -0
  20. data/test/outputs/agshow_1.yml +31 -0
  21. data/test/outputs/agshow_2.txt +4 -0
  22. data/test/outputs/agshow_2.yml +3 -0
  23. data/test/outputs/apt_policy_1.txt +6 -0
  24. data/test/outputs/apt_policy_1.yml +3 -0
  25. data/test/outputs/cfgshow_1.txt +5 -0
  26. data/test/outputs/cfgshow_1.yml +7 -0
  27. data/test/outputs/cfgshow_2.txt +31 -0
  28. data/test/outputs/cfgshow_2.yml +32 -0
  29. data/test/outputs/cfgshow_3.txt +9 -0
  30. data/test/outputs/cfgshow_3.yml +12 -0
  31. data/test/outputs/cfgtransshow_1.txt +2 -0
  32. data/test/outputs/cfgtransshow_1.yml +5 -0
  33. data/test/outputs/cfgtransshow_2.txt +3 -0
  34. data/test/outputs/cfgtransshow_2.yml +4 -0
  35. data/test/outputs/cfgtransshow_3.txt +3 -0
  36. data/test/outputs/cfgtransshow_3.yml +4 -0
  37. data/test/outputs/chassisname_1.txt +2 -0
  38. data/test/outputs/chassisname_1.yml +3 -0
  39. data/test/outputs/dlsshow_1.txt +4 -0
  40. data/test/outputs/dlsshow_1.yml +4 -0
  41. data/test/outputs/dlsshow_2.txt +4 -0
  42. data/test/outputs/dlsshow_2.yml +4 -0
  43. data/test/outputs/fabricshow_1.txt +10 -0
  44. data/test/outputs/fabricshow_1.yml +34 -0
  45. data/test/outputs/iodshow_1.txt +4 -0
  46. data/test/outputs/iodshow_1.yml +4 -0
  47. data/test/outputs/islshow_1.txt +6 -0
  48. data/test/outputs/islshow_1.yml +62 -0
  49. data/test/outputs/islshow_2.txt +2 -0
  50. data/test/outputs/islshow_2.yml +2 -0
  51. data/test/outputs/lscfg_show_1.txt +71 -0
  52. data/test/outputs/lscfg_show_1.yml +5 -0
  53. data/test/outputs/ns_1.txt +80 -0
  54. data/test/outputs/ns_1.yml +39 -0
  55. data/test/outputs/ns_2.txt +37 -0
  56. data/test/outputs/ns_2.yml +21 -0
  57. data/test/outputs/putty.log +1867 -0
  58. data/test/outputs/switch_1.txt +25 -0
  59. data/test/outputs/switch_1.yml +73 -0
  60. data/test/outputs/switch_2.txt +18 -0
  61. data/test/outputs/switch_2.yml +42 -0
  62. data/test/outputs/switch_3.txt +14 -0
  63. data/test/outputs/switch_3.yml +46 -0
  64. data/test/outputs/switchstatusshow_1.txt +21 -0
  65. data/test/outputs/switchstatusshow_1.yml +19 -0
  66. data/test/outputs/trunkshow_1.txt +8 -0
  67. data/test/outputs/trunkshow_1.yml +44 -0
  68. data/test/outputs/trunkshow_2.txt +2 -0
  69. data/test/outputs/trunkshow_2.yml +2 -0
  70. data/test/outputs/version_1.txt +6 -0
  71. data/test/outputs/version_1.yml +8 -0
  72. data/test/outputs/vf_switch_1.txt +25 -0
  73. data/test/outputs/vf_switch_1.yml +73 -0
  74. data/test/provisioning_test.rb +1043 -0
  75. data/test/switch_test.rb +476 -0
  76. data/test/wwn_test.rb +41 -0
  77. data/test/zone_configuration_test.rb +65 -0
  78. data/test/zone_test.rb +73 -0
  79. metadata +170 -0
@@ -0,0 +1,7 @@
1
+ > agshow
2
+ Worldwide Name Ports Enet IP Addr Firmware Local/Remote Name
3
+ ------------------------------------------------------------------------------------------------------
4
+ 10:00:00:11:0a:00:84:a2 24 15.84.68.94 v6.1.0_uth8 remote VCFC2CN8314D00X
5
+ 10:00:00:11:0a:00:85:29 24 15.84.68.96 v6.1.0_uth8 remote VCFC2CN8311D0B3
6
+ 10:00:50:eb:1a:25:fc:ae 24 10.200.16.161 v7.1.1c local H4C13R253-U12-ICB03
7
+ 10:00:50:eb:1a:27:f6:02 24 10.200.16.111 v7.1.1c local H4C13R253-U02-ICB03
@@ -0,0 +1,31 @@
1
+ :parsing_position: end
2
+ :ag:
3
+ -
4
+ :ports: 24
5
+ :wwn: '10:00:00:11:0a:00:84:a2'
6
+ :eth_ip: 15.84.68.94
7
+ :version: v6.1.0_uth8
8
+ :name: VCFC2CN8314D00X
9
+ :local: false
10
+ -
11
+ :ports: 24
12
+ :wwn: '10:00:00:11:0a:00:85:29'
13
+ :eth_ip: 15.84.68.96
14
+ :version: v6.1.0_uth8
15
+ :name: VCFC2CN8311D0B3
16
+ :local: false
17
+ -
18
+ :ports: 24
19
+ :wwn: '10:00:50:eb:1a:25:fc:ae'
20
+ :eth_ip: 10.200.16.161
21
+ :version: v7.1.1c
22
+ :name: H4C13R253-U12-ICB03
23
+ :local: true
24
+ -
25
+ :ports: 24
26
+ :wwn: '10:00:50:eb:1a:27:f6:02'
27
+ :eth_ip: 10.200.16.111
28
+ :version: v7.1.1c
29
+ :name: H4C13R253-U02-ICB03
30
+ :local: true
31
+
@@ -0,0 +1,4 @@
1
+ > agshow
2
+ Worldwide Name Ports Enet IP Addr Firmware Local/Remote Name
3
+ ------------------------------------------------------------------------------------------------------
4
+ No Access Gateway is registered with this fabric
@@ -0,0 +1,3 @@
1
+ :parsing_position: end
2
+ :ag: []
3
+
@@ -0,0 +1,6 @@
1
+ > aptpolicy
2
+ Current Policy: 3
3
+
4
+ 3 : Default Policy
5
+ 1: Port Based Routing Policy
6
+ 3: Exchange Based Routing Policy
@@ -0,0 +1,3 @@
1
+ :current_policy: '3'
2
+
3
+ :parsing_position: end
@@ -0,0 +1,5 @@
1
+ > cfgshow | grep -e cfg: -e configuration:
2
+ Defined configuration:
3
+ cfg: AIS_IDA_SANA
4
+ Effective configuration:
5
+ cfg: AIS_IDA_SANA
@@ -0,0 +1,7 @@
1
+ :defined_configuration:
2
+ :cfg:
3
+ AIS_IDA_SANA: []
4
+ :effective_configuration:
5
+ :cfg:
6
+ AIS_IDA_SANA: []
7
+ :parsing_position: end
@@ -0,0 +1,31 @@
1
+ > cfgshow
2
+ Defined configuration:
3
+ cfg: AIS_IDA_SANA zone1;
4
+ zone2;zone3
5
+ zone: zone1 alias1;
6
+ alias2
7
+ zone: zone2 alias1;
8
+ alias3
9
+ zone: zone3
10
+ alias3;alias4
11
+ zone: zone5 alias1;alias4
12
+ alias: alias1 50:01:43:80:03:BC:68:00
13
+ alias: alias2
14
+ 50:01:43:80:12:0E:2B:60
15
+ alias: alias3
16
+ 50:01:43:80:12:0E:25:18
17
+ alias: alias4
18
+ 50:01:43:80:18:69:33:70
19
+
20
+ Effective configuration:
21
+ cfg: AIS_IDA_SANA
22
+ zone: zone1
23
+ 50:01:43:80:03:BC:68:00
24
+ 50:01:43:80:12:0E:2B:60
25
+ zone: zone2
26
+ 50:01:43:80:03:BC:68:00
27
+ 50:01:43:80:12:0E:25:18
28
+ zone: zone3
29
+ 50:01:43:80:12:0E:25:18
30
+ 50:01:43:80:18:69:33:70
31
+
@@ -0,0 +1,32 @@
1
+ :defined_configuration:
2
+ :cfg:
3
+ AIS_IDA_SANA:
4
+ - zone1
5
+ - zone2
6
+ - zone3
7
+ :zone:
8
+ zone1:
9
+ - alias1
10
+ - alias2
11
+ zone2:
12
+ - alias1
13
+ - alias3
14
+ zone3:
15
+ - alias3
16
+ - alias4
17
+ zone5:
18
+ - alias1
19
+ - alias4
20
+ :alias:
21
+ alias1:
22
+ - 50:01:43:80:03:BC:68:00
23
+ alias2:
24
+ - 50:01:43:80:12:0E:2B:60
25
+ alias3:
26
+ - 50:01:43:80:12:0E:25:18
27
+ alias4:
28
+ - 50:01:43:80:18:69:33:70
29
+ :effective_configuration:
30
+ :cfg:
31
+ AIS_IDA_SANA: []
32
+ :parsing_position: end
@@ -0,0 +1,9 @@
1
+ > cfgshow | grep -e cfg: -e configuration:
2
+ Defined configuration:
3
+ cfg: atc2b1c AIS_A3parp01_3par01_G8; AIS_abfmp01_eva01;
4
+ cfg: atc2b1c_2014_01_29_1136
5
+ cfg: atc2b1c_Jan3rd_2014
6
+ cfg: atc2b1c_Nov6th_2013
7
+ Effective configuration:
8
+ cfg: atc2b1c
9
+
@@ -0,0 +1,12 @@
1
+ :defined_configuration:
2
+ :cfg:
3
+ atc2b1c:
4
+ - AIS_A3parp01_3par01_G8
5
+ - AIS_abfmp01_eva01
6
+ atc2b1c_2014_01_29_1136: []
7
+ atc2b1c_Jan3rd_2014: []
8
+ atc2b1c_Nov6th_2013: []
9
+ :effective_configuration:
10
+ :cfg:
11
+ atc2b1c: []
12
+ :parsing_position: end
@@ -0,0 +1,2 @@
1
+ > cfgtransshow
2
+ There is no outstanding zoning transaction
@@ -0,0 +1,5 @@
1
+ :cfg_transaction:
2
+ :id: -1
3
+ :abortable:
4
+ :msg: "no transaction"
5
+ :parsing_position: end
@@ -0,0 +1,3 @@
1
+ > cfgtransshow
2
+ Current transaction token is 215468647
3
+ It is abortable
@@ -0,0 +1,4 @@
1
+ :cfg_transaction:
2
+ :id: "215468647"
3
+ :abortable: true
4
+ :parsing_position: end
@@ -0,0 +1,3 @@
1
+ > cfgtransshow
2
+ Current transaction token is 0xfffff0
3
+ It is not abortable
@@ -0,0 +1,4 @@
1
+ :cfg_transaction:
2
+ :id: "0xfffff0"
3
+ :abortable: false
4
+ :parsing_position: end
@@ -0,0 +1,2 @@
1
+ > chassisname
2
+ IDAA1C01_chass
@@ -0,0 +1,3 @@
1
+ :chassisname: IDAA1C01_chass
2
+
3
+ :parsing_position: end
@@ -0,0 +1,4 @@
1
+ > dlsshow
2
+
3
+ DLS is set by default with current routing policy
4
+
@@ -0,0 +1,4 @@
1
+ :dlsshow: 'DLS is set by default with current routing policy'
2
+ :parsing_position: end
3
+
4
+
@@ -0,0 +1,4 @@
1
+ > dlsshow
2
+
3
+ DLS is not set
4
+
@@ -0,0 +1,4 @@
1
+ :dlsshow: 'DLS is not set'
2
+ :parsing_position: end
3
+
4
+
@@ -0,0 +1,10 @@
1
+ > fabricshow
2
+ Switch ID Worldwide Name Enet IP Addr FC IP Addr Name
3
+ -------------------------------------------------------------------------
4
+ 1: fffc01 10:00:00:05:1e:4c:24:00 15.187.118.17 0.0.0.0 >"IDAA1C01"
5
+ 2: fffc02 10:00:00:05:33:25:16:00 15.187.118.52 0.0.0.0 "IDAA1C02"
6
+ 129: fffc81 10:00:00:05:1e:50:ad:00 15.187.119.18 0.0.0.0 "GREA1C01"
7
+ 132: fffc84 10:00:00:05:33:25:12:00 15.187.119.38 0.0.0.0 "GREA1C02"
8
+
9
+ The Fabric has 4 switches
10
+
@@ -0,0 +1,34 @@
1
+ :parsing_position: end
2
+ :fabric:
3
+ -
4
+ :domain_id: '1'
5
+ :sid: 'fffc01'
6
+ :wwn: '10:00:00:05:1e:4c:24:00'
7
+ :eth_ip: 15.187.118.17
8
+ :fc_ip: 0.0.0.0
9
+ :name: IDAA1C01
10
+ :local: true
11
+ -
12
+ :domain_id: '2'
13
+ :sid: 'fffc02'
14
+ :wwn: '10:00:00:05:33:25:16:00'
15
+ :eth_ip: 15.187.118.52
16
+ :fc_ip: 0.0.0.0
17
+ :name: IDAA1C02
18
+ :local: false
19
+ -
20
+ :domain_id: '129'
21
+ :sid: 'fffc81'
22
+ :wwn: '10:00:00:05:1e:50:ad:00'
23
+ :eth_ip: 15.187.119.18
24
+ :fc_ip: 0.0.0.0
25
+ :name: GREA1C01
26
+ :local: false
27
+ -
28
+ :domain_id: '132'
29
+ :sid: 'fffc84'
30
+ :wwn: '10:00:00:05:33:25:12:00'
31
+ :eth_ip: 15.187.119.38
32
+ :fc_ip: 0.0.0.0
33
+ :name: GREA1C02
34
+ :local: false
@@ -0,0 +1,4 @@
1
+ > iodshow
2
+
3
+ IOD is set
4
+
@@ -0,0 +1,4 @@
1
+ :iodshow: 'IOD is set'
2
+ :parsing_position: end
3
+
4
+
@@ -0,0 +1,6 @@
1
+ > islshow
2
+ 1: 0-> 0 10:00:00:05:33:23:86:00 1 H2C04R065-U03-A sp: 8.000G bw: 64.000G TRUNK QOS
3
+ 2: 8-> 17 10:00:00:05:33:c6:f7:23 29 H4C11R218-U02-I sp: 8.000G bw: 8.000G
4
+ 17: 32-> 64 10:00:00:27:f8:34:f7:00 41 DXS-898-U03-A01 sp: 4.000G bw: 4.000G CR_RECOV
5
+ 18: 18->176 10:00:00:05:33:9b:d2:00 2 H4C11R215-U03-A sp: 8.000G bw: 8.000G
6
+ 38:217-> 18 10:00:00:05:33:bd:13:a7 24 H2C04R085-U25-I sp: 8.000G bw: 8.000G
@@ -0,0 +1,62 @@
1
+ :parsing_position: end
2
+ :isl_links:
3
+ -
4
+ :id: 1
5
+ :source_port_index: 0
6
+ :destination_port_index: 0
7
+ :destination_switch_wwn: 10:00:00:05:33:23:86:00
8
+ :destination_switch_domain: 1
9
+ :destination_switch_name: H2C04R065-U03-A
10
+ :speed: 8
11
+ :bandwidth: 64
12
+ :trunk: true
13
+ :qos: true
14
+ :cr_recov: false
15
+ -
16
+ :id: 2
17
+ :source_port_index: 8
18
+ :destination_port_index: 17
19
+ :destination_switch_wwn: 10:00:00:05:33:c6:f7:23
20
+ :destination_switch_domain: 29
21
+ :destination_switch_name: H4C11R218-U02-I
22
+ :speed: 8
23
+ :bandwidth: 8
24
+ :trunk: false
25
+ :qos: false
26
+ :cr_recov: false
27
+ -
28
+ :id: 17
29
+ :source_port_index: 32
30
+ :destination_port_index: 64
31
+ :destination_switch_wwn: 10:00:00:27:f8:34:f7:00
32
+ :destination_switch_domain: 41
33
+ :destination_switch_name: DXS-898-U03-A01
34
+ :speed: 4
35
+ :bandwidth: 4
36
+ :trunk: false
37
+ :qos: false
38
+ :cr_recov: true
39
+ -
40
+ :id: 18
41
+ :source_port_index: 18
42
+ :destination_port_index: 176
43
+ :destination_switch_wwn: 10:00:00:05:33:9b:d2:00
44
+ :destination_switch_domain: 2
45
+ :destination_switch_name: H4C11R215-U03-A
46
+ :speed: 8
47
+ :bandwidth: 8
48
+ :trunk: false
49
+ :qos: false
50
+ :cr_recov: false
51
+ -
52
+ :id: 38
53
+ :source_port_index: 217
54
+ :destination_port_index: 18
55
+ :destination_switch_wwn: 10:00:00:05:33:bd:13:a7
56
+ :destination_switch_domain: 24
57
+ :destination_switch_name: H2C04R085-U25-I
58
+ :speed: 8
59
+ :bandwidth: 8
60
+ :trunk: false
61
+ :qos: false
62
+ :cr_recov: false
@@ -0,0 +1,2 @@
1
+ > islshow
2
+ No ISL found
@@ -0,0 +1,2 @@
1
+ :parsing_position: end
2
+ :isl_links: []
@@ -0,0 +1,71 @@
1
+ > lscfg --show
2
+
3
+ Created switches: 128(ds) 99
4
+ Slot 1 2 3 4 5 6 7 8 9 10 11 12
5
+ -------------------------------------------------------------------------------
6
+ Port
7
+ 0 | 128 | 128 | 128 | 99 | 128 | | | 128 | 99 | 128 | 128 | 128 |
8
+ 1 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
9
+ 2 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
10
+ 3 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
11
+ 4 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
12
+ 5 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
13
+ 6 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
14
+ 7 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
15
+ 8 | 99 | 99 | 99 | 128 | 128 | | | 128 | 128 | 128 | 99 | 99 |
16
+ 9 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
17
+ 10 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
18
+ 11 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
19
+ 12 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
20
+ 13 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
21
+ 14 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
22
+ 15 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
23
+ 16 | 128 | 128 | 128 | 128 | 128 | | | 128 | 99 | 99 | 128 | 99 |
24
+ 17 | 128 | 128 | 128 | 99 | 128 | | | 128 | 99 | 99 | 128 | 128 |
25
+ 18 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
26
+ 19 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
27
+ 20 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
28
+ 21 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
29
+ 22 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
30
+ 23 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
31
+ 24 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 99 | 128 |
32
+ 25 | 99 | 99 | 99 | 128 | 128 | | | 128 | 99 | 99 | 128 | 128 |
33
+ 26 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
34
+ 27 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
35
+ 28 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
36
+ 29 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
37
+ 30 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
38
+ 31 | 128 | 128 | 128 | 128 | 128 | | | 128 | 128 | 128 | 128 | 128 |
39
+ 32 | | | | | | | | | | | | |
40
+ 33 | | | | | | | | | | | | |
41
+ 34 | | | | | | | | | | | | |
42
+ 35 | | | | | | | | | | | | |
43
+ 36 | | | | | | | | | | | | |
44
+ 37 | | | | | | | | | | | | |
45
+ 38 | | | | | | | | | | | | |
46
+ 39 | | | | | | | | | | | | |
47
+ 40 | | | | | | | | | | | | |
48
+ 41 | | | | | | | | | | | | |
49
+ 42 | | | | | | | | | | | | |
50
+ 43 | | | | | | | | | | | | |
51
+ 44 | | | | | | | | | | | | |
52
+ 45 | | | | | | | | | | | | |
53
+ 46 | | | | | | | | | | | | |
54
+ 47 | | | | | | | | | | | | |
55
+ 48 | | | | | | | | | | | | |
56
+ 49 | | | | | | | | | | | | |
57
+ 50 | | | | | | | | | | | | |
58
+ 51 | | | | | | | | | | | | |
59
+ 52 | | | | | | | | | | | | |
60
+ 53 | | | | | | | | | | | | |
61
+ 54 | | | | | | | | | | | | |
62
+ 55 | | | | | | | | | | | | |
63
+ 56 | | | | | | | | | | | | |
64
+ 57 | | | | | | | | | | | | |
65
+ 58 | | | | | | | | | | | | |
66
+ 59 | | | | | | | | | | | | |
67
+ 60 | | | | | | | | | | | | |
68
+ 61 | | | | | | | | | | | | |
69
+ 62 | | | | | | | | | | | | |
70
+ 63 | | | | | | | | | | | | |
71
+