Sha256: d7fef47c0eb6f93a097f201db91353d0704a17f383ba33b44ff72ea16e15afc6
Contents?: true
Size: 798 Bytes
Versions: 15
Compression:
Stored size: 798 Bytes
Contents
require 'spec_helper' describe BigBrother::IPVS do describe "#running_configuration" do it "returns a parsed version of the running config" do executor = StubExecutor.new executor.add_response("ipvsadm --save --numeric", <<-OUTPUT, 0) -A -f 3 -s wrr -a -f 3 -r 10.0.1.220:80 -i -w 1 -a -f 3 -r 10.0.1.221:80 -i -w 1 -a -f 3 -r 10.0.1.222:80 -i -w 1 -A -f 1 -s wrr -a -f 1 -r 10.0.1.223:80 -i -w 1 -a -f 1 -r 10.0.1.224:80 -i -w 1 -A -f 2 -s wrr -a -f 2 -r 10.0.1.225:80 -i -w 1 OUTPUT config = BigBrother::IPVS.new(executor).running_configuration config.size.should == 3 config['3'].should == ['10.0.1.220', '10.0.1.221', '10.0.1.222'] config['1'].should == ['10.0.1.223', '10.0.1.224'] config['2'].should == ['10.0.1.225'] end end end
Version data entries
15 entries across 15 versions & 1 rubygems