lib/testlab/network/status.rb in testlab-0.0.4 vs lib/testlab/network/status.rb in testlab-0.1.0

- old
+ new

@@ -8,11 +8,29 @@ interface = "#{bridge}:#{ip}" { :id => self.id, :node_id => self.node.id, :state => self.state, - :interface => interface + :interface => interface, + :broadcast => self.broadcast, + :network => self.network, + :netmask => self.netmask } + end + + # Returns the network mask + def netmask + TestLab::Utility.netmask(self.ip) + end + + # Returns the network address + def network + TestLab::Utility.network(self.ip) + end + + # Returns the broadcast address + def broadcast + TestLab::Utility.broadcast(self.ip) end # Network Bridge State def state output = self.node.ssh.exec(%(sudo ifconfig #{self.bridge} | grep 'MTU'), :silence => true, :ignore_exit_status => true).output.strip