コード例 #1
0
def main(argv):
    conf = argv[1] if len(argv) > 1 else '/mnt/other/work/ceph_test/ceph/src/ceph.conf'
    pool_name = "obpool"

    cluster = connect(conf)
    # if not create_pool(cluster, pool_name, "zlib"):
    #     return -1

    logger.info("Test test_volume started")
    if test_volume(cluster, pool_name):
        logger.info("Test failed, exit")
        cluster.shutdown()
        return -1

    cluster.shutdown()
コード例 #2
0
ファイル: rbd_test.py プロジェクト: ifed01/compression_tests
def main(argv):
    conf = argv[1] if len(
        argv) > 1 else '/mnt/other/work/ceph_test/ceph/src/ceph.conf'
    pool_name = "obpool"

    cluster = connect(conf)
    # if not create_pool(cluster, pool_name, "zlib"):
    #     return -1

    logger.info("Test test_volume started")
    if test_volume(cluster, pool_name):
        logger.info("Test failed, exit")
        cluster.shutdown()
        return -1

    cluster.shutdown()
コード例 #3
0
def main(argv):
    conf = argv[1] if len(argv) > 1 else '/mnt/other/work/ceph_test/ceph/src/ceph.conf'
    pool_name = "test"

    cluster = connect(conf)
    # if not create_pool(cluster, pool_name, "zlib"):
    #     return -1

    datafuncs = [lambda n: ''.join([chr(ord('0')+i%10) for i in range(0, n)]), # for content test
                 lambda n: ''.zfill(n),
                 os.urandom,
                 lambda n: os.urandom(n/2).center(n, '\x00')]

    for i, datafunc in enumerate(datafuncs):
        logger.info("Test test_pool by %i func started", i)
        if test_pool(cluster, pool_name, datafunc):
            logger.info("Test failed, exit")
            cluster.shutdown()
            return -1

    cluster.shutdown()
コード例 #4
0
def main(argv):
    conf = argv[1] if len(argv) > 1 else '/mnt/other/work/ceph_test/ceph/src/ceph.conf'
    do_reduced_test = argv[2] == '/reduced' if len(argv)>2 else False
    pool_name = "test"
    cluster = connect(conf)
    # if not create_pool(cluster, pool_name, "zlib"):
    #     return -1

    datafuncs = [lambda n: ''.join([chr(ord('0')+i%10) for i in range(0, n)]), # for content test
                 lambda n: ''.zfill(n),
                 os.urandom,
                 lambda n: os.urandom(n/2).center(n, '\x00')]

    for i, datafunc in enumerate(datafuncs):
        logger.info(">>>>>> Testing datafunc  %i ... ", i)
        if test_pool(cluster, pool_name, i, datafunc, do_reduced_test):
            logger.error(">>>>>> Test failed, exit")
            cluster.shutdown()
            return -1
        logger.info(">>>>>> Testing datafunc  %i completed", i)

    cluster.shutdown()