diff --git a/Makefile b/Makefile index f7d1e63..e8869db 100644 --- a/Makefile +++ b/Makefile @@ -85,8 +85,7 @@ check: $(OBJS) $(CHECK_BINS) r=true ; for bin in $(CHECK_BINS); do $$bin || r=false; done ; $$r acceptance: build - $(MAKE) -C tests/acceptance/ld_preloads all - cd tests/acceptance && LD_PRELOADS=$$(echo ld_preloads/*.o) RUBYOPT='-I.' ruby nbd_scenarios -v + cd tests/acceptance && RUBYOPT='-I.' ruby nbd_scenarios -v test: check acceptance @@ -109,8 +108,6 @@ install: clean: rm -rf build/* - $(RM) $(LD_PRELOAD_OBJ) - .PHONY: clean objs check_objs all server proxy check_bins check doc build test acceptance diff --git a/tests/acceptance/test_serve_mode.rb b/tests/acceptance/test_serve_mode.rb index cdf3e58..5aa8912 100644 --- a/tests/acceptance/test_serve_mode.rb +++ b/tests/acceptance/test_serve_mode.rb @@ -40,10 +40,17 @@ class TestServeMode < Test::Unit::TestCase end def setup_msync_catcher + `make -C ld_preloads/ msync_catcher.o` + omit 'LD_PRELOAD library not found' unless + File.exist?('ld_preloads/msync_catcher.o') + @msync_catcher = Tempfile.new('msync') ENV['MSYNC_CATCHER_OUTPUT'] = @msync_catcher.path + + @ld_preload_orig = ENV['LD_PRELOAD'] + ENV['LD_PRELOAD'] = 'ld_preloads/msync_catcher.o' end - + def parse_msync_output op = [] until @msync_catcher.eof? @@ -56,7 +63,9 @@ class TestServeMode < Test::Unit::TestCase def teardown_msync_catcher @msync_catcher.close if @msync_catcher + ENV.delete 'MSYNC_CATCHER_OUTPUT' + ENV['LD_PRELOAD'] = @ld_preload_orig end def test_bad_request_magic_receives_error_response