mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-06 10:25:17 +00:00
a31849c6c5
Locking functionality pushed down to Core
32 lines
848 B
Python
32 lines
848 B
Python
from Tank.Plugins.ShellExec import ShellExecPlugin
|
|
from Tests.TankTests import TankTestCase
|
|
import logging
|
|
import select
|
|
import subprocess
|
|
import tempfile
|
|
import unittest
|
|
|
|
class ShellExecPluginTestCase(TankTestCase):
|
|
def setUp(self):
|
|
core = self.get_core()
|
|
core.load_configs(['config/shellexec.conf'])
|
|
self.foo = ShellExecPlugin(core)
|
|
|
|
def tearDown(self):
|
|
del self.foo
|
|
self.foo = None
|
|
|
|
def test_run(self):
|
|
self.foo.configure()
|
|
self.foo.prepare_test()
|
|
self.foo.start_test()
|
|
self.foo.end_test(0)
|
|
|
|
def test_select(self):
|
|
pipes = subprocess.Popen(["pwd"], stdout=subprocess.PIPE)
|
|
r, w, x = select.select([pipes.stdout], [], [], 1)
|
|
logging.info("selected: %s %s %s", r, w, x)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|