test_influxdb.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:fuel-ccp-tests 作者: openstack 项目源码 文件源码
def workload_fixture_generator(command):
    @pytest.yield_fixture
    def workload(admin_node):

        pids = set()

        def _make_workload():
            pid = admin_node.check_call('{} & echo $!'.format(
                command)).stdout_str
            # check process is running
            cmd = 'ls /proc/{}'.format(pid)
            err_msg = "Background process with pid `{}` is not found".format(
                pid)
            assert admin_node.execute(cmd).exit_code == 0, err_msg
            pids.add(pid)

        yield _make_workload

        for pid in pids:
            admin_node.execute('kill {}'.format(pid))

    return workload
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号