diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-09-19 16:26:58 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-09-19 16:26:58 -0400 |
commit | 24d2457c2eab89f135e2b483f05d52eee0169af7 (patch) | |
tree | a4395d57b19d2f49d4297f567305f148dff7fdf2 | |
parent | a637b5f74948324173219a2e7817c7f19d864281 (diff) | |
download | vyos-cloud-init-24d2457c2eab89f135e2b483f05d52eee0169af7.tar.gz vyos-cloud-init-24d2457c2eab89f135e2b483f05d52eee0169af7.zip |
remove unit test.
the unit test required access to /dev/console due to the logging.
-rw-r--r-- | tests/unittests/test_signal.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/unittests/test_signal.py b/tests/unittests/test_signal.py deleted file mode 100644 index 8cb31fd7..00000000 --- a/tests/unittests/test_signal.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Tests for handling of signals within cloud init.""" - -import subprocess -import sys -import time - -from StringIO import StringIO - -from mocker import MockerTestCase - - -class TestSignal(MockerTestCase): - - def test_signal_output(self): - - # This is done since nose/unittest is actually setting up - # output capturing, signal handling itself, and its easier - # to just call out to cloudinit with a loop and see what the result is - run_what = [sys.executable, - '-c', - ('import time; from cloudinit import signal_handler;' - 'signal_handler.attach_handlers(); time.sleep(120)')] - - pc_info = subprocess.Popen(run_what, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE) - - # Let it start up - time.sleep(0.5) - dead = None - while dead is None: - pc_info.terminate() - # Ok not dead yet. try again - time.sleep(0.5) - dead = pc_info.poll() - - outputs = StringIO() - if pc_info.stdout: - outputs.write(pc_info.stdout.read()) - if pc_info.stderr: - outputs.write(pc_info.stderr.read()) - val = outputs.getvalue() - - # Check some of the outputs that should of happened - self.assertEquals(1, pc_info.wait()) - self.assertTrue(len(val) != 0) - self.assertTrue(val.find("terminated") != -1) |