brocadesan 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,25 @@
1
+ > switchshow
2
+ switchName: IDAA1C01
3
+ switchType: 62.3
4
+ switchState: Online
5
+ switchMode: Native
6
+ switchRole: Principal
7
+ switchDomain: 1
8
+ switchId: fffc01
9
+ switchWwn: 10:00:00:05:1e:4c:24:00
10
+ zoning: ON (AIS_IDA_SANA)
11
+ switchBeacon: OFF
12
+ FC Router: OFF
13
+ Allow XISL Use: OFF
14
+ LS Attributes: [FID: 128, Base Switch: No, Default Switch: Yes, Address Mode 0]
15
+
16
+ Index Slot Port Address Media Speed State Proto
17
+ ===================================================
18
+ 0 1 0 010000 id 4G Online FC F-Port 50:00:1f:e1:50:12:c4:e8
19
+ 5 1 5 010500 id N4 Online FC F-Port 1 N Port + 10 NPIV public
20
+ 6 1 6 010600 id N8 No_Sync FC Disabled (Persistent)
21
+ 7 1 7 010700 id 8G Online FC E-Port 10:00:00:05:33:25:16:00 "IDAA1C02"
22
+ 384 5 0 ------ cu 8G No_Sync FC
23
+
24
+
25
+
@@ -0,0 +1,73 @@
1
+ :switch_name: IDAA1C01
2
+ :switch_type: "62.3"
3
+ :switch_state: Online
4
+ :switch_mode: Native
5
+ :switch_role: Principal
6
+ :switch_domain: "1"
7
+ :switch_id: fffc01
8
+ :switch_wwn: 10:00:00:05:1e:4c:24:00
9
+ :zoning_enabled: true
10
+ :active_config: AIS_IDA_SANA
11
+ :switch_beacon: "OFF"
12
+ :fc_router: "OFF"
13
+ :allow_xisl_use: "OFF"
14
+ :ls_attributes:
15
+ :fid: "128"
16
+ :base_switch: "no"
17
+ :default_switch: "yes"
18
+ :address_mode: "0"
19
+
20
+
21
+ :ports:
22
+ -
23
+ :index: 0
24
+ :slot: 1
25
+ :port: 0
26
+ :address: "010000"
27
+ :media: id
28
+ :speed: 4G
29
+ :state: Online
30
+ :proto: FC
31
+ :comment: 'F-Port 50:00:1f:e1:50:12:c4:e8'
32
+ -
33
+ :index: 5
34
+ :slot: 1
35
+ :port: 5
36
+ :address: "010500"
37
+ :media: id
38
+ :speed: N4
39
+ :state: Online
40
+ :proto: FC
41
+ :comment: 'F-Port 1 N Port + 10 NPIV public'
42
+ -
43
+ :index: 6
44
+ :slot: 1
45
+ :port: 6
46
+ :address: "010600"
47
+ :media: id
48
+ :speed: N8
49
+ :state: No_Sync
50
+ :proto: FC
51
+ :comment: 'Disabled (Persistent)'
52
+ -
53
+ :index: 7
54
+ :slot: 1
55
+ :port: 7
56
+ :address: "010700"
57
+ :media: id
58
+ :speed: 8G
59
+ :state: Online
60
+ :proto: FC
61
+ :comment: 'E-Port 10:00:00:05:33:25:16:00 "IDAA1C02"'
62
+ -
63
+ :index: 384
64
+ :slot: 5
65
+ :port: 0
66
+ :address: ------
67
+ :media: cu
68
+ :speed: 8G
69
+ :state: No_Sync
70
+ :proto: FC
71
+ :comment: ''
72
+
73
+ :parsing_position: end
@@ -0,0 +1,18 @@
1
+ > switchshow
2
+ switchName: H4C11R218-U02-ICB04
3
+ switchType: 72.3
4
+ switchState: Online
5
+ switchMode: Native
6
+ switchRole: Subordinate
7
+ switchDomain: 29
8
+ switchId: fffc1d
9
+ switchWwn: 10:00:00:05:33:c6:e8:f6
10
+ zoning: ON (ECS_SAN_B)
11
+ switchBeacon: OFF
12
+
13
+ Index Port Address Media Speed State Proto
14
+ ==============================================
15
+ 0 0 1d0000 -- N8 No_Module FC
16
+ 1 1 1d0100 cu AN No_Sync FC
17
+ 17 17 1d1100 id N8 Online FC E-Port 10:00:00:05:33:9b:de:00 "H4C11R228-U03-B02" (upstream)
18
+
@@ -0,0 +1,42 @@
1
+ :switch_name: H4C11R218-U02-ICB04
2
+ :switch_type: "72.3"
3
+ :switch_state: Online
4
+ :switch_mode: Native
5
+ :switch_role: Subordinate
6
+ :switch_domain: "29"
7
+ :switch_id: fffc1d
8
+ :switch_wwn: 10:00:00:05:33:c6:e8:f6
9
+ :zoning_enabled: true
10
+ :active_config: ECS_SAN_B
11
+ :switch_beacon: "OFF"
12
+
13
+ :ports:
14
+ -
15
+ :index: 0
16
+ :port: 0
17
+ :address: "1d0000"
18
+ :media: --
19
+ :speed: N8
20
+ :state: No_Module
21
+ :proto: FC
22
+ :comment: ''
23
+ -
24
+ :index: 1
25
+ :port: 1
26
+ :address: "1d0100"
27
+ :media: cu
28
+ :speed: AN
29
+ :state: No_Sync
30
+ :proto: FC
31
+ :comment: ''
32
+ -
33
+ :index: 17
34
+ :port: 17
35
+ :address: "1d1100"
36
+ :media: id
37
+ :speed: N8
38
+ :state: Online
39
+ :proto: FC
40
+ :comment: 'E-Port 10:00:00:05:33:9b:de:00 "H4C11R228-U03-B02" (upstream)'
41
+
42
+ :parsing_position: end
@@ -0,0 +1,14 @@
1
+ > switchshow
2
+ switchName: H4C13R253-U02-ICB03
3
+ switchType: 72.3
4
+ switchState: Online
5
+ switchMode: Access Gateway Mode
6
+ switchWwn: 10:00:50:eb:1a:27:f6:02
7
+ switchBeacon: OFF
8
+
9
+ Index Port Address Media Speed State Proto
10
+ ==================================================
11
+ 0 0 530000 -- N8 No_Module FC (POD License Not Assigned Yet)
12
+ 1 1 530100 cu N8 Online FC F-Port 50:01:43:80:26:65:92:bc 0x023102
13
+ 7 7 530700 cu AN No_Sync FC
14
+ 17 17 531100 id N8 Online FC N-Port 10:00:00:05:33:9b:d2:00 0x023100
@@ -0,0 +1,46 @@
1
+ :switch_name: H4C13R253-U02-ICB03
2
+ :switch_type: "72.3"
3
+ :switch_state: Online
4
+ :switch_mode: Access Gateway Mode
5
+ :switch_wwn: 10:00:50:eb:1a:27:f6:02
6
+ :switch_beacon: "OFF"
7
+
8
+ :ports:
9
+ -
10
+ :index: 0
11
+ :port: 0
12
+ :address: "530000"
13
+ :media: --
14
+ :speed: N8
15
+ :state: No_Module
16
+ :proto: FC
17
+ :comment: '(POD License Not Assigned Yet)'
18
+ -
19
+ :index: 1
20
+ :port: 1
21
+ :address: "530100"
22
+ :media: cu
23
+ :speed: N8
24
+ :state: Online
25
+ :proto: FC
26
+ :comment: 'F-Port 50:01:43:80:26:65:92:bc 0x023102'
27
+ -
28
+ :index: 7
29
+ :port: 7
30
+ :address: "530700"
31
+ :media: cu
32
+ :speed: AN
33
+ :state: No_Sync
34
+ :proto: FC
35
+ :comment: ''
36
+ -
37
+ :index: 17
38
+ :port: 17
39
+ :address: "531100"
40
+ :media: id
41
+ :speed: N8
42
+ :state: Online
43
+ :proto: FC
44
+ :comment: 'N-Port 10:00:00:05:33:9b:d2:00 0x023100'
45
+
46
+ :parsing_position: end
@@ -0,0 +1,21 @@
1
+ > switchstatusshow
2
+ Switch Health Report Report time: 04/23/2013 10:56:38 AM
3
+ Switch Name: IDAA1C01
4
+ IP address: 15.187.118.17
5
+ SwitchState: HEALTHY
6
+ Duration: 56:01
7
+
8
+ Power supplies monitor HEALTHY
9
+ Temperatures monitor HEALTHY
10
+ Fans monitor HEALTHY
11
+ WWN servers monitor HEALTHY
12
+ CP monitor HEALTHY
13
+ Blades monitor HEALTHY
14
+ Core Blades monitor HEALTHY
15
+ Flash monitor HEALTHY
16
+ Marginal ports monitor HEALTHY
17
+ Faulty ports monitor HEALTHY
18
+ Missing SFPs monitor HEALTHY
19
+
20
+
21
+ All ports are healthy
@@ -0,0 +1,19 @@
1
+ :switch_health_report_report_time: '04/23/2013 10:56:38 AM'
2
+ :switch_name: IDAA1C01
3
+ :ip_address: 15.187.118.17
4
+ :switch_state: HEALTHY
5
+ :duration: '56:01'
6
+ :switchstatusshow: |
7
+ Power supplies monitor HEALTHY
8
+ Temperatures monitor HEALTHY
9
+ Fans monitor HEALTHY
10
+ WWN servers monitor HEALTHY
11
+ CP monitor HEALTHY
12
+ Blades monitor HEALTHY
13
+ Core Blades monitor HEALTHY
14
+ Flash monitor HEALTHY
15
+ Marginal ports monitor HEALTHY
16
+ Faulty ports monitor HEALTHY
17
+ Missing SFPs monitor HEALTHY
18
+ All ports are healthy
19
+ :parsing_position: end
@@ -0,0 +1,8 @@
1
+ > trunkshow
2
+ 1: 0-> 0 10:00:00:05:33:23:86:00 1 deskew 149 MASTER
3
+ 1-> 1 10:00:00:05:33:23:86:00 1 deskew 15
4
+ 6->116 10:00:00:05:33:9b:d2:00 2 deskew 96
5
+
6
+ 2: 16-> 16 10:00:00:05:33:23:86:00 1 deskew 15 MASTER
7
+ 17-> 17 10:00:00:05:33:23:86:00 1 deskew 15
8
+
@@ -0,0 +1,44 @@
1
+ :parsing_position: end
2
+ :trunk_links:
3
+ -
4
+ :id: 1
5
+ :members:
6
+ -
7
+ :source_port_index: 0
8
+ :destination_port_index: 0
9
+ :destination_switch_wwn: 10:00:00:05:33:23:86:00
10
+ :destination_switch_domain: 1
11
+ :deskew: 149
12
+ :master: true
13
+ -
14
+ :source_port_index: 1
15
+ :destination_port_index: 1
16
+ :destination_switch_wwn: 10:00:00:05:33:23:86:00
17
+ :destination_switch_domain: 1
18
+ :deskew: 15
19
+ :master: false
20
+ -
21
+ :source_port_index: 6
22
+ :destination_port_index: 116
23
+ :destination_switch_wwn: 10:00:00:05:33:9b:d2:00
24
+ :destination_switch_domain: 2
25
+ :deskew: 96
26
+ :master: false
27
+
28
+ -
29
+ :id: 2
30
+ :members:
31
+ -
32
+ :source_port_index: 16
33
+ :destination_port_index: 16
34
+ :destination_switch_wwn: 10:00:00:05:33:23:86:00
35
+ :destination_switch_domain: 1
36
+ :deskew: 15
37
+ :master: true
38
+ -
39
+ :source_port_index: 17
40
+ :destination_port_index: 17
41
+ :destination_switch_wwn: 10:00:00:05:33:23:86:00
42
+ :destination_switch_domain: 1
43
+ :deskew: 15
44
+ :master: false
@@ -0,0 +1,2 @@
1
+ > trunkshow
2
+ No trunking links
@@ -0,0 +1,2 @@
1
+ :parsing_position: end
2
+ :trunk_links: []
@@ -0,0 +1,6 @@
1
+ > version
2
+ Kernel: 2.6.14.2
3
+ Fabric OS: v6.4.3b
4
+ Made on: Tue Sep 4 22:03:15 2012
5
+ Flash: Fri Oct 12 14:05:20 2012
6
+ BootProm: 1.0.15
@@ -0,0 +1,8 @@
1
+ :kernel: 2.6.14.2
2
+ :fabric_os: v6.4.3b
3
+ :boot_prom: 1.0.15
4
+ :made_on: "Tue Sep 4 22:03:15 2012"
5
+ :flash: "Fri Oct 12 14:05:20 2012"
6
+
7
+
8
+ :parsing_position: end
@@ -0,0 +1,25 @@
1
+ > fosexec --fid 99 'switchshow'
2
+ switchName: IDAA1C01
3
+ switchType: 62.3
4
+ switchState: Online
5
+ switchMode: Native
6
+ switchRole: Principal
7
+ switchDomain: 1
8
+ switchId: fffc01
9
+ switchWwn: 10:00:00:05:1e:4c:24:00
10
+ zoning: ON (AIS_IDA_SANA)
11
+ switchBeacon: OFF
12
+ FC Router: OFF
13
+ Allow XISL Use: OFF
14
+ LS Attributes: [FID: 99, Base Switch: No, Default Switch: Yes, Address Mode 0]
15
+
16
+ Index Slot Port Address Media Speed State Proto
17
+ ===================================================
18
+ 0 1 0 010000 id 4G Online FC F-Port 50:00:1f:e1:50:12:c4:e8
19
+ 5 1 5 010500 id N4 Online FC F-Port 1 N Port + 10 NPIV public
20
+ 6 1 6 010600 id N8 No_Sync FC Disabled (Persistent)
21
+ 7 1 7 010700 id 8G Online FC E-Port 10:00:00:05:33:25:16:00 "IDAA1C02"
22
+ 384 5 0 ------ cu 8G No_Sync FC
23
+
24
+
25
+
@@ -0,0 +1,73 @@
1
+ :switch_name: IDAA1C01
2
+ :switch_type: "62.3"
3
+ :switch_state: Online
4
+ :switch_mode: Native
5
+ :switch_role: Principal
6
+ :switch_domain: "1"
7
+ :switch_id: fffc01
8
+ :switch_wwn: 10:00:00:05:1e:4c:24:00
9
+ :zoning_enabled: true
10
+ :active_config: AIS_IDA_SANA
11
+ :switch_beacon: "OFF"
12
+ :fc_router: "OFF"
13
+ :allow_xisl_use: "OFF"
14
+ :ls_attributes:
15
+ :fid: "99"
16
+ :base_switch: "no"
17
+ :default_switch: "yes"
18
+ :address_mode: "0"
19
+
20
+
21
+ :ports:
22
+ -
23
+ :index: 0
24
+ :slot: 1
25
+ :port: 0
26
+ :address: "010000"
27
+ :media: id
28
+ :speed: 4G
29
+ :state: Online
30
+ :proto: FC
31
+ :comment: 'F-Port 50:00:1f:e1:50:12:c4:e8'
32
+ -
33
+ :index: 5
34
+ :slot: 1
35
+ :port: 5
36
+ :address: "010500"
37
+ :media: id
38
+ :speed: N4
39
+ :state: Online
40
+ :proto: FC
41
+ :comment: 'F-Port 1 N Port + 10 NPIV public'
42
+ -
43
+ :index: 6
44
+ :slot: 1
45
+ :port: 6
46
+ :address: "010600"
47
+ :media: id
48
+ :speed: N8
49
+ :state: No_Sync
50
+ :proto: FC
51
+ :comment: 'Disabled (Persistent)'
52
+ -
53
+ :index: 7
54
+ :slot: 1
55
+ :port: 7
56
+ :address: "010700"
57
+ :media: id
58
+ :speed: 8G
59
+ :state: Online
60
+ :proto: FC
61
+ :comment: 'E-Port 10:00:00:05:33:25:16:00 "IDAA1C02"'
62
+ -
63
+ :index: 384
64
+ :slot: 5
65
+ :port: 0
66
+ :address: ------
67
+ :media: cu
68
+ :speed: 8G
69
+ :state: No_Sync
70
+ :proto: FC
71
+ :comment: ''
72
+
73
+ :parsing_position: end