From 988b2ec0147fb3bff7b648128633fba5be094005 Mon Sep 17 00:00:00 2001 From: Alex Young Date: Tue, 3 Jul 2012 10:59:31 +0100 Subject: [PATCH] Moved acceptance tests into tests/acceptance --- Rakefile | 4 +--- tests/{ => acceptance}/fakes/dest/close_after_hello.rb | 0 tests/{ => acceptance}/fakes/dest/error_on_write.rb | 0 tests/{ => acceptance}/fakes/dest/hang_after_connect.rb | 0 tests/{ => acceptance}/fakes/dest/hang_after_write.rb | 0 tests/{ => acceptance}/fakes/dest/hello_wrong_magic.rb | 0 tests/{ => acceptance}/fakes/dest/hello_wrong_size.rb | 0 tests/{ => acceptance}/fakes/dest/reject_acl.rb | 0 tests/{ => acceptance}/fakes/source/close_after_connect.rb | 0 tests/{ => acceptance}/fakes/source/close_after_hello.rb | 0 tests/{ => acceptance}/fakes/source/connect_during_hello.rb | 0 tests/{ => acceptance}/fakes/source/connect_from_banned_ip.rb | 0 tests/{ => acceptance}/fakes/source/hang_after_hello.rb | 0 tests/{ => acceptance}/fakes/source/write_out_of_range.rb | 0 tests/{ => acceptance}/flexnbd.rb | 0 tests/{ => acceptance}/flexnbd/constants.rb | 0 tests/{ => acceptance}/flexnbd/fake_dest.rb | 0 tests/{ => acceptance}/flexnbd/fake_source.rb | 0 tests/{ => acceptance}/nbd_scenarios | 4 ++-- tests/{ => acceptance}/test_file_writer.rb | 0 20 files changed, 3 insertions(+), 5 deletions(-) rename tests/{ => acceptance}/fakes/dest/close_after_hello.rb (100%) rename tests/{ => acceptance}/fakes/dest/error_on_write.rb (100%) rename tests/{ => acceptance}/fakes/dest/hang_after_connect.rb (100%) rename tests/{ => acceptance}/fakes/dest/hang_after_write.rb (100%) rename tests/{ => acceptance}/fakes/dest/hello_wrong_magic.rb (100%) rename tests/{ => acceptance}/fakes/dest/hello_wrong_size.rb (100%) rename tests/{ => acceptance}/fakes/dest/reject_acl.rb (100%) rename tests/{ => acceptance}/fakes/source/close_after_connect.rb (100%) rename tests/{ => acceptance}/fakes/source/close_after_hello.rb (100%) rename tests/{ => acceptance}/fakes/source/connect_during_hello.rb (100%) rename tests/{ => acceptance}/fakes/source/connect_from_banned_ip.rb (100%) rename tests/{ => acceptance}/fakes/source/hang_after_hello.rb (100%) rename tests/{ => acceptance}/fakes/source/write_out_of_range.rb (100%) rename tests/{ => acceptance}/flexnbd.rb (100%) rename tests/{ => acceptance}/flexnbd/constants.rb (100%) rename tests/{ => acceptance}/flexnbd/fake_dest.rb (100%) rename tests/{ => acceptance}/flexnbd/fake_source.rb (100%) rename tests/{ => acceptance}/nbd_scenarios (98%) rename tests/{ => acceptance}/test_file_writer.rb (100%) diff --git a/Rakefile b/Rakefile index be2d9e0..4e49aa7 100644 --- a/Rakefile +++ b/Rakefile @@ -11,9 +11,7 @@ ALL_SOURCES =FileList['src/*'] SOURCES = ALL_SOURCES.select { |c| c =~ /\.c$/ } OBJECTS = SOURCES.pathmap( "%{^src,build}X.o" ) TEST_SOURCES = FileList['tests/unit/*.c'] -p TEST_SOURCES TEST_OBJECTS = TEST_SOURCES.pathmap( "%{^tests/unit,build/tests}X.o" ) -p TEST_OBJECTS LIBS = %w( pthread ) CCFLAGS = %w( @@ -68,7 +66,7 @@ namespace "test" do desc "Run NBD test scenarios" task 'scenarios' => 'flexnbd' do - sh "cd tests; ruby nbd_scenarios" + sh "cd tests/acceptance; ruby nbd_scenarios" end end diff --git a/tests/fakes/dest/close_after_hello.rb b/tests/acceptance/fakes/dest/close_after_hello.rb similarity index 100% rename from tests/fakes/dest/close_after_hello.rb rename to tests/acceptance/fakes/dest/close_after_hello.rb diff --git a/tests/fakes/dest/error_on_write.rb b/tests/acceptance/fakes/dest/error_on_write.rb similarity index 100% rename from tests/fakes/dest/error_on_write.rb rename to tests/acceptance/fakes/dest/error_on_write.rb diff --git a/tests/fakes/dest/hang_after_connect.rb b/tests/acceptance/fakes/dest/hang_after_connect.rb similarity index 100% rename from tests/fakes/dest/hang_after_connect.rb rename to tests/acceptance/fakes/dest/hang_after_connect.rb diff --git a/tests/fakes/dest/hang_after_write.rb b/tests/acceptance/fakes/dest/hang_after_write.rb similarity index 100% rename from tests/fakes/dest/hang_after_write.rb rename to tests/acceptance/fakes/dest/hang_after_write.rb diff --git a/tests/fakes/dest/hello_wrong_magic.rb b/tests/acceptance/fakes/dest/hello_wrong_magic.rb similarity index 100% rename from tests/fakes/dest/hello_wrong_magic.rb rename to tests/acceptance/fakes/dest/hello_wrong_magic.rb diff --git a/tests/fakes/dest/hello_wrong_size.rb b/tests/acceptance/fakes/dest/hello_wrong_size.rb similarity index 100% rename from tests/fakes/dest/hello_wrong_size.rb rename to tests/acceptance/fakes/dest/hello_wrong_size.rb diff --git a/tests/fakes/dest/reject_acl.rb b/tests/acceptance/fakes/dest/reject_acl.rb similarity index 100% rename from tests/fakes/dest/reject_acl.rb rename to tests/acceptance/fakes/dest/reject_acl.rb diff --git a/tests/fakes/source/close_after_connect.rb b/tests/acceptance/fakes/source/close_after_connect.rb similarity index 100% rename from tests/fakes/source/close_after_connect.rb rename to tests/acceptance/fakes/source/close_after_connect.rb diff --git a/tests/fakes/source/close_after_hello.rb b/tests/acceptance/fakes/source/close_after_hello.rb similarity index 100% rename from tests/fakes/source/close_after_hello.rb rename to tests/acceptance/fakes/source/close_after_hello.rb diff --git a/tests/fakes/source/connect_during_hello.rb b/tests/acceptance/fakes/source/connect_during_hello.rb similarity index 100% rename from tests/fakes/source/connect_during_hello.rb rename to tests/acceptance/fakes/source/connect_during_hello.rb diff --git a/tests/fakes/source/connect_from_banned_ip.rb b/tests/acceptance/fakes/source/connect_from_banned_ip.rb similarity index 100% rename from tests/fakes/source/connect_from_banned_ip.rb rename to tests/acceptance/fakes/source/connect_from_banned_ip.rb diff --git a/tests/fakes/source/hang_after_hello.rb b/tests/acceptance/fakes/source/hang_after_hello.rb similarity index 100% rename from tests/fakes/source/hang_after_hello.rb rename to tests/acceptance/fakes/source/hang_after_hello.rb diff --git a/tests/fakes/source/write_out_of_range.rb b/tests/acceptance/fakes/source/write_out_of_range.rb similarity index 100% rename from tests/fakes/source/write_out_of_range.rb rename to tests/acceptance/fakes/source/write_out_of_range.rb diff --git a/tests/flexnbd.rb b/tests/acceptance/flexnbd.rb similarity index 100% rename from tests/flexnbd.rb rename to tests/acceptance/flexnbd.rb diff --git a/tests/flexnbd/constants.rb b/tests/acceptance/flexnbd/constants.rb similarity index 100% rename from tests/flexnbd/constants.rb rename to tests/acceptance/flexnbd/constants.rb diff --git a/tests/flexnbd/fake_dest.rb b/tests/acceptance/flexnbd/fake_dest.rb similarity index 100% rename from tests/flexnbd/fake_dest.rb rename to tests/acceptance/flexnbd/fake_dest.rb diff --git a/tests/flexnbd/fake_source.rb b/tests/acceptance/flexnbd/fake_source.rb similarity index 100% rename from tests/flexnbd/fake_source.rb rename to tests/acceptance/flexnbd/fake_source.rb diff --git a/tests/nbd_scenarios b/tests/acceptance/nbd_scenarios similarity index 98% rename from tests/nbd_scenarios rename to tests/acceptance/nbd_scenarios index d9ab4b8..7665453 100644 --- a/tests/nbd_scenarios +++ b/tests/acceptance/nbd_scenarios @@ -16,8 +16,8 @@ class Environment @available_ports = [*40000..41000] - listening_ports @port1 = @available_ports.shift @port2 = @available_ports.shift - @nbd1 = FlexNBD.new("../build/flexnbd", @ip, @port1) - @nbd2 = FlexNBD.new("../build/flexnbd", @ip, @port2) + @nbd1 = FlexNBD.new("../../build/flexnbd", @ip, @port1) + @nbd2 = FlexNBD.new("../../build/flexnbd", @ip, @port2) @fake_pid = nil end diff --git a/tests/test_file_writer.rb b/tests/acceptance/test_file_writer.rb similarity index 100% rename from tests/test_file_writer.rb rename to tests/acceptance/test_file_writer.rb