mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
Fix Lintian error: unsafe symlinks exist only while testing.
We only need these actions during test time, so create symlinks to them before running the tests and remove them after testing: - actions/echo: /bin/echo - actions/id: /usr/bin/id
This commit is contained in:
parent
c5ceae5819
commit
2b4e17e425
@ -1 +0,0 @@
|
|||||||
/bin/echo
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/usr/bin/id
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
# -*- mode: python; mode: auto-fill; fill-column: 80 -*-
|
# -*- mode: python; mode: auto-fill; fill-column: 80 -*-
|
||||||
|
|
||||||
from actions import superuser_run, run
|
from actions import superuser_run, run
|
||||||
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -12,7 +13,19 @@ class TestPrivileged(unittest.TestCase):
|
|||||||
|
|
||||||
See actions.py for a full description of the expectations.
|
See actions.py for a full description of the expectations.
|
||||||
|
|
||||||
|
Symlink to ``echo`` and ``id`` during testing.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
os.symlink("/bin/echo", "actions/echo")
|
||||||
|
os.symlink("/usr/bin/id", "actions/id")
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
os.remove("actions/echo")
|
||||||
|
os.remove("actions/id")
|
||||||
|
|
||||||
def test_run_as_root(self):
|
def test_run_as_root(self):
|
||||||
"""1. Privileged actions run as root.
|
"""1. Privileged actions run as root.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user