예제 #1
0
 def test_install(self):
     task = Task()
     task.assert_that(Package('python3-virtualenv'), installed())
     task.assert_that(Package('virtualenv'), installed())
     task.command('rm dist/*', expected=None)
     task.command('python setup.py sdist', timeout=20)
     task.command('virtualenv --clear venv', timeout=10)
     task.command(
         '. venv/bin/activate; pip install dist/prego*; echo y | pip uninstall prego; deactivate',
         timeout=50)
예제 #2
0
    def test_netcat(self):
        ctx.port = 2000
        server = Task(desc='netcat server', detach=True)
        server.assert_that(Package('nmap'), installed())
        server.assert_that(localhost, hamcrest.is_not(listen_port(ctx.port)))
        cmd = server.command('ncat -l -p $port')
        server.assert_that(cmd.stdout.content, hamcrest.contains_string('bye'))

        client = Task(desc='netcat client')
        client.wait_that(server, running())
        client.wait_that(localhost, listen_port(ctx.port))
        client.command('ncat -c "echo bye" localhost $port')
예제 #3
0
 def test_installed_version(self):
     depends = Task()
     depends.assert_that(Package('bash'), installed(min_version='3.0'))
예제 #4
0
 def test_installed(self):
     depends = Task()
     depends.assert_that(Package('bash'), installed())
     depends.assert_that(Package('never-installed'), is_not(installed()))
예제 #5
0
파일: test.py 프로젝트: UCLM-ESI/upper
 def test(self):
     Task().assert_that(Package('python3-twisted'), installed())