summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-06 09:22:21 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-06 09:22:21 +0000
commit3859d767e11c09b2a824172af86204939e1a5c98 (patch)
tree39a3e1bc7d1ce723ceb2d90977d301b3652f1e43
parent4bb910816e98c5b059f263ab65ff8076349be9c2 (diff)
* test/webrick/test_filehandler.rb: on vboxsf (on VirtualBox
on Windows 7), file name and permissions are strange (can access by short file name and so on). Simply skip on such tests on such FS. To detect strange FS, this patch use a part of code `File.executable?(__FILE__)`. Please correct them if there are better ways. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog12
-rw-r--r--test/webrick/test_filehandler.rb14
2 files changed, 21 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index dc75fa41da..3b75535421 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,18 @@
+Fri Mar 6 18:19:13 2015 Koichi Sasada <ko1@atdot.net>
+
+ * test/webrick/test_filehandler.rb: on vboxsf (on VirtualBox
+ on Windows 7), file name and permissions are strange (can access
+ by short file name and so on).
+
+ Simply skip on such tests on such FS. To detect strange FS, this
+ patch use a part of code `File.executable?(__FILE__)`.
+ Please correct them if there are better ways.
+
Fri Mar 6 17:31:29 2015 Koichi Sasada <ko1@atdot.net>
* test/ruby/test_beginendblock.rb: do not change directory.
- Run system command in the directory mounted by vboxfs on Windows 7
+ Run system command in the directory mounted by vboxsf on Windows 7
and get warning like that "warning: Insecure world writable dir...".
Fri Mar 6 10:31:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb
index f984efb3ac..e120e6dd2a 100644
--- a/test/webrick/test_filehandler.rb
+++ b/test/webrick/test_filehandler.rb
@@ -166,7 +166,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
def test_non_disclosure_name
config = { :DocumentRoot => File.dirname(__FILE__), }
log_tester = lambda {|log, access_log|
- log = log.reject {|s| /ERROR `.*' not found\./ =~ s }
+ log = log.reject {|s| /ERROR `.*\' not found\./ =~ s }
log = log.reject {|s| /WARN the request refers nondisclosure name/ =~ s }
assert_equal([], log)
}
@@ -193,10 +193,12 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
end
def test_directory_traversal
+ return if File.executable?(__FILE__) # skip on strange file system
+
config = { :DocumentRoot => File.dirname(__FILE__), }
log_tester = lambda {|log, access_log|
log = log.reject {|s| /ERROR bad URI/ =~ s }
- log = log.reject {|s| /ERROR `.*' not found\./ =~ s }
+ log = log.reject {|s| /ERROR `.*\' not found\./ =~ s }
assert_equal([], log)
}
TestWEBrick.start_httpserver(config, log_tester) do |server, addr, port, log|
@@ -222,13 +224,15 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
end
def test_short_filename
+ return if File.executable?(__FILE__) # skip on strange file system
+
config = {
:CGIInterpreter => TestWEBrick::RubyBin,
:DocumentRoot => File.dirname(__FILE__),
:CGIPathEnv => ENV['PATH'],
}
log_tester = lambda {|log, access_log|
- log = log.reject {|s| /ERROR `.*' not found\./ =~ s }
+ log = log.reject {|s| /ERROR `.*\' not found\./ =~ s }
log = log.reject {|s| /WARN the request refers nondisclosure name/ =~ s }
assert_equal([], log)
}
@@ -262,6 +266,8 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
end
def test_script_disclosure
+ return if File.executable?(__FILE__) # skip on strange file system
+
config = {
:CGIInterpreter => TestWEBrick::RubyBin,
:DocumentRoot => File.dirname(__FILE__),
@@ -276,7 +282,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
},
}
log_tester = lambda {|log, access_log|
- log = log.reject {|s| /ERROR `.*' not found\./ =~ s }
+ log = log.reject {|s| /ERROR `.*\' not found\./ =~ s }
assert_equal([], log)
}
TestWEBrick.start_httpserver(config, log_tester) do |server, addr, port, log|