Compare commits

...

14 Commits

Author SHA1 Message Date
Patrick J Cherry
83884e9449 Merged in another test fix 2015-04-02 11:53:33 +01:00
Patrick J Cherry
06d78d4168 Scaled back the massive allocation of IPs from 11 /24s to 4.
Otherwise I get

Error: test_massively_parallel_IP_address_addition(TestAddr::TestWithNetlinkRouteSocket)
  Errno::EMFILE: Too many open files - socket(2)
  lib/linux/netlink/nlsocket.rb:61:in `initialize'
  lib/linux/netlink/nlsocket.rb:61:in `new'
  lib/linux/netlink/nlsocket.rb:61:in `initialize'
  lib/linux/netlink/route.rb:21:in `initialize'
  test/t_route.rb:54:in `new'
  test/t_route.rb:54:in `block (4 levels) in <class:TestAddr>'
2015-04-02 11:52:56 +01:00
Patrick J Cherry
4a248b5a76 Merged in new tests 2015-04-02 11:45:13 +01:00
Patrick J Cherry
2ceb0fbf6d Make sure link exists before proceeding with test 2015-04-02 11:44:40 +01:00
Patrick J Cherry
654f6df6cb Merged in new tests 2015-04-01 23:06:32 +01:00
Patrick J Cherry
51b8bbcd8a Fixed new massive IP test thing to work with ruby1.8 and also non-root users 2015-04-01 23:05:41 +01:00
Patrick J Cherry
5c2b81524f Added tag 0.17-1+wheezy1 for changeset 7f35922899a3 2015-04-01 22:47:25 +01:00
Patrick J Cherry
0e2fa83a72 New wheezy release 2015-04-01 22:46:50 +01:00
Patrick J Cherry
aa45b7fa3e Added tag 0.17 for changeset ecf38b43dd66 2015-04-01 22:43:23 +01:00
Patrick J Cherry
981eb2ec29 Version bump 2015-04-01 22:43:20 +01:00
nick
6ebbdbbf87 Update gemspec 2014-08-27 10:24:13 +01:00
nick
71ac26af38 Automated merge with ssh://dev.bytemark.co.uk//repos/netlinkrb 2014-08-27 09:06:49 +01:00
nick
4afbfa91c0 tests: Add a create-many-IPs-in-parallel test, as this is a common operation 2014-08-27 09:06:44 +01:00
Patrick J Cherry
05e54f22e8 Added tag 0.16-1+wheezy1 for changeset c0eb6a0f135a 2014-08-26 16:34:27 +01:00
3 changed files with 35 additions and 2 deletions

6
debian/changelog vendored
View File

@@ -1,3 +1,9 @@
ruby-linux-netlink (0.17-1+wheezy1) stable; urgency=medium
* New upstream release
-- Patrick J Cherry <patrick@bytemark.co.uk> Wed, 01 Apr 2015 22:44:51 +0100
ruby-linux-netlink (0.16-1+wheezy1) stable; urgency=medium ruby-linux-netlink (0.16-1+wheezy1) stable; urgency=medium
* New upstream release. * New upstream release.

View File

@@ -5,9 +5,9 @@ $:.unshift lib unless $:.include? lib
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = "netlinkrb" s.name = "netlinkrb"
s.version = "0.12" s.version = "0.17"
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.authors = ["Brian Candler", "Matthew Bloch", "Patrick Cherry", "Alex Young"] s.authors = ["Brian Candler", "Matthew Bloch", "Patrick Cherry", "Alex Young", "Nicholas Thomas"]
s.email = ["matthew@bytemark.co.uk"] s.email = ["matthew@bytemark.co.uk"]
s.summary = "Interface to Linux' Netlink API" s.summary = "Interface to Linux' Netlink API"
s.description = "Ruby native interface to the Netlink API which avoids shelling out to command-line tools as much as possible." s.description = "Ruby native interface to the Netlink API which avoids shelling out to command-line tools as much as possible."

View File

@@ -40,6 +40,33 @@ class TestAddr < Test::Unit::TestCase
end end
end end
test "massively parallel IP address addition" do
@ifname = create_test_interface
return if @ifname.nil?
link = @ip.link.list.find{|x| x.ifname == @ifname}
return if link.nil?
ips = (10..13).map {|y| (1..254).map {|z| "10.100.#{y}.#{z}" } }.flatten.compact
threads = ips.map {|ip|
Thread.new {
Linux::Netlink::Route::Socket.new.addr.add(
:index => @ifname,
:local => ip,
:prefixlen => 8
)
}
}
threads.map{|t| t.join }
created = @ip.addr.list(:index => @ifname, :family => Socket::AF_INET).
map {|ifaddr| ifaddr.address.to_s }
ips.each {|ip| assert created.include?( ip ), "#{ip} was not created" }
end
def create_test_interface(ifname = "test_#{$$}") def create_test_interface(ifname = "test_#{$$}")
begin begin
@ip.link.add( @ip.link.add(