Permalink
Browse files

Remove Travis debugging code and fix RequestHandlerTest in sudo mode.

  • Loading branch information...
1 parent ae9f107 commit ef9b68c35c3b0f234a71de4de5ea8b3b0d02b35c @FooBarWidget FooBarWidget committed Apr 25, 2013
Showing with 8 additions and 7 deletions.
  1. +0 −7 dev/run_travis.sh
  2. +5 −0 ext/common/ApplicationPool2/Spawner.h
  3. +3 −0 test/cxx/RequestHandlerTest.cpp
View
@@ -15,13 +15,6 @@ sudo sh -c 'cat >> /etc/hosts' <<EOF
127.0.0.1 7.passenger.test 8.passenger.test 9.passenger.test
EOF
-echo "$ cat /etc/passwd"
-cat /etc/passwd
-echo "$ id"
-id
-echo "$ rvmsudo id"
-rvmsudo id
-
if [[ "$TEST_RUBY_VERSION" != "" ]]; then
echo "$ rvm use $TEST_RUBY_VERSION"
source ~/.rvm/scripts/rvm
@@ -801,6 +801,7 @@ class Spawner {
return;
}
+ UPDATE_TRACE_POINT();
string defaultGroup;
string startupFile = absolutizePath(options.getStartupFile(), info.appRoot);
struct passwd *userInfo = NULL;
@@ -823,6 +824,7 @@ class Spawner {
defaultGroup = options.defaultGroup;
}
+ UPDATE_TRACE_POINT();
if (!options.user.empty()) {
userInfo = getpwnam(options.user.c_str());
} else {
@@ -838,6 +840,7 @@ class Spawner {
userInfo = getpwnam(options.defaultUser.c_str());
}
+ UPDATE_TRACE_POINT();
if (!options.group.empty()) {
if (options.group == "!STARTUP_FILE!") {
struct stat buf;
@@ -857,13 +860,15 @@ class Spawner {
groupInfo = getgrnam(defaultGroup.c_str());
}
+ UPDATE_TRACE_POINT();
if (userInfo == NULL) {
throw RuntimeException("Cannot determine a user to lower privilege to");
}
if (groupInfo == NULL) {
throw RuntimeException("Cannot determine a group to lower privilege to");
}
+ UPDATE_TRACE_POINT();
#ifdef __APPLE__
int groups[1024];
info.ngroups = sizeof(groups) / sizeof(int);
@@ -3,6 +3,7 @@
#include <agents/HelperAgent/RequestHandler.cpp>
#include <agents/HelperAgent/AgentOptions.h>
#include <ApplicationPool2/Pool.h>
+#include <Utils/json.h>
#include <Utils/IOUtils.h>
#include <Utils/Timer.h>
@@ -48,6 +49,8 @@ namespace tut {
setLogLevel(LVL_ERROR); // TODO: set to LVL_WARN
agentOptions.passengerRoot = resourceLocator->getRoot();
+ agentOptions.defaultUser = testConfig["default_user"].asString();
+ agentOptions.defaultGroup = testConfig["default_group"].asString();
root = resourceLocator->getRoot();
rackAppPath = root + "/test/stub/rack";
wsgiAppPath = root + "/test/stub/wsgi";

0 comments on commit ef9b68c

Please sign in to comment.