I have to test a custom cli. When I change a value using a command
inside cli I use “show” command to check expected values. The show
command output produces a multiline string where I can see different
name/value pairs.The output string is :
"
Status | Disabled
Alias | DP1
Chaddr | 11:22:33:44:55:66
Chaddr Exclude | false
Chaddr Mask | FF:FF:FF:FF:F8:00
Client ID |
Client ID Exclude | false
DHCP Server IP Address | 192.168.200.254
Locally Served | false
Order | 1
User Class ID |
User Class ID Exclude | false
Vendor Class ID |
Vendor Class ID Exclude | false
Vendor Class ID Mode | Exact
Interface in | br0
Interface out | eth4
dhcprpool1:
Enable | true
Status | Disabled
Alias | DP2
Chaddr | 11:22:33:44:55:66
Chaddr Exclude | false
Chaddr Mask | FF:FF:FF:FF:F8:00
Client ID |
Client ID Exclude | false
DHCP Server IP Address | 192.168.200.254
Locally Served | false
Order | 1
User Class ID |
User Class ID Exclude | false
Vendor Class ID |
Vendor Class ID Exclude | false
Vendor Class ID Mode | Exact
Interface in | br0
Interface out | eth4
"
n order to check if values are correct I would like build two hashes for
every item ( dhcprpool0 and dhcprpool1). I would like two hashes in
Ruby,i.e.:
dhcprpool0 = {“Enable” => “true”, “Status” => Disabled,“Alias”=>“DP1”
…}
dhcprpool1 = {“Enable” => “true”, “Status” => Disabled,
“Alias”=>“DP2”… }
How can I make it ?
Thanks