Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running tests as root fails #26

Open
miekg opened this issue Nov 22, 2022 · 2 comments
Open

running tests as root fails #26

miekg opened this issue Nov 22, 2022 · 2 comments

Comments

@miekg
Copy link
Owner

miekg commented Nov 22, 2022

[sudo] password for miek: 
--- FAIL: TestEndToEnd (0.00s)
    main_test.go:74: run(exec) = -c flag is mandatory, want not root
FAIL
exit status 1

normally this would not be an issue, but I probably want to run the go test in the github actions workflow as root, so bind mounts and the like can easily be created, or should we mock that in some kind of way? WDYT @matttproud ?

@matttproud
Copy link
Collaborator

matttproud commented Nov 22, 2022 via email

@miekg
Copy link
Owner Author

miekg commented Nov 22, 2022

How many things require root: systemd interactions and bind mounting and privilege setting with subcommands?

yes mostly that: mount, mkdir/chown and systemd.

Note for systemd we just call the command you don't actually get the feedback if the restart was successful (that's available with 'status' or via journald). So in that sense we could just test that we run the correct command.

Bind mounts however....Maybe in we can do it in a namespace? But system wide needs root, maybe also check that we run in the correct command(s)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants