Changeset 183
- Timestamp:
- 07/30/08 15:49:27 (4 months ago)
- Files:
-
- nethorus/app/models/bridge.rb (modified) (2 diffs)
- nethorus/test/unit/bridge_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nethorus/app/models/bridge.rb
r168 r183 40 40 41 41 validates_inclusion_of :dot1d_stp_priority, :in => 1..65535, :message => "must be in the range 1-65535" 42 validates_inclusion_of :dot1d_stp_root_cost, :in => 1..2147483647, :message => "must be in the range 1-2147483647"42 validates_inclusion_of :dot1d_stp_root_cost, :in => 0..2147483647, :message => "must be in the range 0-2147483647" 43 43 validates_inclusion_of :dot1d_stp_max_age, :in => 1..2147483647, :message => "must be in the range 1-2147483647" 44 44 validates_inclusion_of :dot1d_stp_hello_time, :in => 1..2147483647, :message => "must be in the range 1-2147483647" … … 48 48 validates_inclusion_of :dot1d_stp_bridge_hello_time, :in => 100..1000, :message => "must be in the range 100-1000" 49 49 50 51 # Returns the L2Interface object corresponding to the STP root port 52 53 def dot1d_stp_root_port_interface 54 55 root_port = self.dot1d_stp_root_port 56 57 root_port_interface = StpPort.find(:first, :conditions => { :dot1d_base_port => root_port, :bridge_id => self.id }) 58 59 end 60 50 61 end nethorus/test/unit/bridge_test.rb
r168 r183 136 136 137 137 @bridge.dot1d_stp_root_cost = 0 138 assert(!@bridge.valid?, "A bridge should not be valid with a dot1d_stp_root_cost of 0") 138 assert(@bridge.valid?, "A bridge should be valid with a dot1d_stp_root_cost of 0") 139 140 @bridge.dot1d_stp_root_cost = -1 141 assert(!@bridge.valid?, "A bridge should not be valid with a dot1d_stp_root_cost of -1") 139 142 140 143 @bridge.dot1d_stp_root_cost = 2147483647 … … 250 253 end 251 254 255 256 # Test the device/bridge relationship 257 258 def test_device_bridge_relationship 259 260 end 261 252 262 end
