Permalink
Browse files

Fix unit test failure on Linux.

  • Loading branch information...
1 parent 2df9cbf commit 65dc28eaedcc7c2f9a299c97635156a151cb4f3d @FooBarWidget FooBarWidget committed Feb 27, 2013
Showing with 12 additions and 1 deletion.
  1. +12 −1 test/cxx/ApplicationPool2/SpawnerTestCases.cpp
@@ -766,6 +766,17 @@
RUN_USER_SWITCHING_TEST();
runShellCommand(("groups " + testConfig["normal_user_1"].asString() + " > /tmp/info2.txt").c_str());
string defaultGroups = strip(readAll("/tmp/info2.txt"));
- // default_groups.gsub!(/.*: */, '')
+
+ // On Linux, the 'groups' output is prepended by the group name so
+ // get rid of that.
+ string::size_type pos = defaultGroups.find(':');
+ if (pos != string::npos) {
+ pos++;
+ while (pos < defaultGroups.size() && defaultGroups[pos] == ' ') {
+ pos++;
+ }
+ defaultGroups.erase(0, pos);
+ }
+
ensure_equals(groups, defaultGroups);
}

0 comments on commit 65dc28e

Please sign in to comment.