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

Allow running unittests as root #373

Merged
merged 3 commits into from
Jan 25, 2021
Merged

Allow running unittests as root #373

merged 3 commits into from
Jan 25, 2021

Conversation

nichtsfrei
Copy link
Member

What:

Faked path check in test_create_paren_dirs_fail to allow the test to pass even when running those tests as root.
Changed test_sudo_available to bypass the uid check to allow verifying that sudo is available even when running those tests as root.

Why:

While building the debian package within docker the tests will be executed as root.

How:

Run the unittests as root.

Checklist:

When you're building a debian package within container.io definition
than you tyically do that as root with access to /root/.

Therefore it is more reliable to work with a mock than relying on
actual access rights on a os while testing.
When running on root test_sudo_available did not check if sudo is
available, to enforce check _is_running_as_root needs to be manually set
to false.
@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

Merging #373 (2bd4862) into master (31534a0) will decrease coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #373      +/-   ##
==========================================
- Coverage   85.73%   85.55%   -0.18%     
==========================================
  Files          10       10              
  Lines        1731     1731              
==========================================
- Hits         1484     1481       -3     
- Misses        247      250       +3     
Impacted Files Coverage Δ
ospd_openvas/daemon.py 68.05% <0.00%> (-0.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31534a0...2bd4862. Read the comment docs.

@jjnicola jjnicola merged commit 62317c8 into greenbone:master Jan 25, 2021
ArnoStiefvater added a commit to ArnoStiefvater/ospd-openvas that referenced this pull request Oct 25, 2021
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

Successfully merging this pull request may close these issues.

2 participants