Esempio n. 1
0
def test_simple_start_stop():
    util.log('[START TEST] start daemonized container and kill it')
    cont_pid = aucont.start_daemonized(util.test_rootfs_path(), '/bin/sleep',
                                       '5')
    util.check(aucont.clist()[0] == cont_pid)
    aucont.stop(cont_pid, 9)
    util.check(len(aucont.clist()) == 0)
Esempio n. 2
0
def test_simple_start_stop():
    util.log('[START TEST] start daemonized container and kill it')
    cont_pid = aucont.start_daemonized(
        util.test_rootfs_path(), '/bin/sleep', '5'
    )
    util.check(aucont.clist()[0] == cont_pid)
    aucont.stop(cont_pid, 9)
    util.check(len(aucont.clist()) == 0)
Esempio n. 3
0
def test_many_cont_list():
    util.log("""[START_TEST] start 3 containers.
        Check that aucont_list tool returns right
        values.""")
    cont1_pid = aucont.start_daemonized(util.test_rootfs_path(), '/bin/sleep',
                                        '1')
    cont2_pid = aucont.start_daemonized(util.test_rootfs_path(), '/bin/sleep',
                                        '5')
    cont3_pid = aucont.start_daemonized(util.test_rootfs_path(), '/bin/sleep',
                                        '10')
    cont_list = aucont.clist()
    util.check(len(cont_list) == 3)
    cont_list.index(cont1_pid)
    cont_list.index(cont2_pid)
    cont_list.index(cont3_pid)
    cleanup()
Esempio n. 4
0
def test_many_cont_list():
    util.log("""[START_TEST] start 3 containers.
        Check that aucont_list tool returns right
        values.""")
    cont1_pid = aucont.start_daemonized(
        util.test_rootfs_path(), '/bin/sleep', '1'
    )
    cont2_pid = aucont.start_daemonized(
        util.test_rootfs_path(), '/bin/sleep', '5'
    )
    cont3_pid = aucont.start_daemonized(
        util.test_rootfs_path(), '/bin/sleep', '10'
    )
    cont_list = aucont.clist()
    util.check(len(cont_list) == 3)
    cont_list.index(cont1_pid)
    cont_list.index(cont2_pid)
    cont_list.index(cont3_pid)
    cleanup()
Esempio n. 5
0
def test_start_with_interactive_shell():
    util.log('[START TEST] start container with interactive shell')
    aucont.start_interactive(
        util.test_rootfs_path(), '/bin/sh'
    )
    util.check(len(aucont.clist()) == 0)
Esempio n. 6
0
def test_start_with_interactive_shell():
    util.log('[START TEST] start container with interactive shell')
    aucont.start_interactive(util.test_rootfs_path(), '/bin/sh')
    util.check(len(aucont.clist()) == 0)