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:
Nick Daly 2014-03-02 16:20:46 -06:00
parent c5ceae5819
commit 2b4e17e425
3 changed files with 13 additions and 2 deletions

View File

@ -1 +0,0 @@
/bin/echo

View File

@ -1 +0,0 @@
/usr/bin/id

View File

@ -2,6 +2,7 @@
# -*- mode: python; mode: auto-fill; fill-column: 80 -*-
from actions import superuser_run, run
import os
import shlex
import subprocess
import sys
@ -12,7 +13,19 @@ class TestPrivileged(unittest.TestCase):
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):
"""1. Privileged actions run as root.