Commit Graph

6 Commits

Author SHA1 Message Date
Zhengchao Liu
55986887a8 test: skip userinfo test if it's run as root
Summary: This test can fail for not having `USERNAME` environment variable when the test is run as root. Let's just skip the test when this happens because it doesn't make sense to drop priv as root.

Reviewed By: xavierd

Differential Revision: D30868518

fbshipit-source-id: 14ff6db218b1477f5905f2df3ad075a5ca186117
2021-09-10 16:42:15 -07:00
Xavier Deguillard
3d362fa62b test: skip userinfo test if USER env isn't set
Summary:
In the ASIC test environment, we've see cases where this isn't set, let's
simply skip the test in this case instead of failing.

Reviewed By: chadaustin

Differential Revision: D30353929

fbshipit-source-id: 956da6f8f12de025b8ca72e40097f1f9d50e6bf7
2021-08-16 17:50:38 -07:00
Adam Simpkins
ea7460f2d3 apply the integration test case blacklist to some more tests
Summary:
Add a new IntegrationTestCase base class that checks the test blacklist during
`setUp()`, and update a few remaining test classes that did not derive from
`EdenTestCase` to derive from this.

Also drop the method name argument from the `skip_test_if_blacklisted()`
function, since we can get this from the existing test case argument.

Reviewed By: genevievehelsel

Differential Revision: D21340539

fbshipit-source-id: d4fc125f119d74ab923c2cc3c9070b86c582c87e
2020-05-04 11:46:09 -07:00
Adam Simpkins
f390948707 fix the UserInfoTest on Ubuntu
Summary:
Run `env` as `/usr/bin/env` instead of `/bin/env`
This command is typically installed in `/usr/bin`.  Recent RedHat releases
replaced `/bin/ with a symlink to `/usr/bin`, allowing this command to work
when invoked as `/bin/env`, but this isn't true on all distributions, such as
Ubuntu.

Reviewed By: chadaustin

Differential Revision: D21340540

fbshipit-source-id: d7588f8c90e9a86a0cb31fd3ab3a9067aa6e79ea
2020-05-04 11:46:08 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Adam Simpkins
73509a87f8 restore the $USER environment variable when dropping privileges
Summary:
If edenfs was started using `sudo`, the `$USER` environment variable will be
set to `root` rather than the actual user.  When we drop privileges make sure
we restore the value of `$USER` as well.

The `$USER` variable isn't checked anywhere else in edenfs itself, but it
matters for subprocesses we spawn, like `hg debugedenimporthelper`.

I also changed the code to clear the `SUDO_*` variables as well, mostly
just for good measure.

Reviewed By: kulshrax

Differential Revision: D15929539

fbshipit-source-id: e022c7ae762e2a5e86d0227058bb476aff17cf55
2019-06-20 21:01:36 -07:00