sapling/tests/test-fb-hgext-ownercheck.t
Kostia Balytskyi b27a46c987 fb-hgext: fix copied fb-hgext tests
Summary:
This is a big bulk of generally almost-obvious fixes to the moved tests. Mostly
these fixes have to do with correct importing of the actual extensions.

Depends on D6675329

Test Plan:
- ./run-tests.py fails less after this commit
- see further commits for more test fixes

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675344
2018-01-09 03:06:09 -08:00

35 lines
898 B
Perl

$ cat >> $HGRCPATH << EOF
> [extensions]
> ownercheck=
> EOF
ownercheck does not prevent normal hg operations
$ hg init repo1
make os.getuid return a different, fake uid
$ cat >> fakeuid.py << EOF
> import os
> _getuid = os.getuid
> def fakeuid(): return _getuid() + 1
> os.getuid = fakeuid
> EOF
ownercheck prevents wrong user from creating new repos
$ hg --config extensions.fakeuid=fakeuid.py init repo2
abort: $TESTTMP is owned by *, not you * (glob)
you are likely doing something wrong.
(you can skip the check using --config extensions.ownercheck=!)
[255]
ownercheck prevents wrong user from accessing existing repos
$ hg --config extensions.fakeuid=fakeuid.py log --repo repo1
abort: $TESTTMP/repo1 is owned by *, not you * (glob)
you are likely doing something wrong.
(you can skip the check using --config extensions.ownercheck=!)
[255]