From 2b4e17e42514753e470d891b4ef2c6a7d0773f18 Mon Sep 17 00:00:00 2001 From: Nick Daly Date: Sun, 2 Mar 2014 16:20:46 -0600 Subject: [PATCH] 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 --- actions/echo | 1 - actions/id | 1 - tests/actions_test.py | 13 +++++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) delete mode 120000 actions/echo delete mode 120000 actions/id diff --git a/actions/echo b/actions/echo deleted file mode 120000 index 7bbf7ccd5..000000000 --- a/actions/echo +++ /dev/null @@ -1 +0,0 @@ -/bin/echo \ No newline at end of file diff --git a/actions/id b/actions/id deleted file mode 120000 index 5f8fa7d02..000000000 --- a/actions/id +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/id \ No newline at end of file diff --git a/tests/actions_test.py b/tests/actions_test.py index df18e40db..c78fdce72 100644 --- a/tests/actions_test.py +++ b/tests/actions_test.py @@ -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.