"user.syndicate_read_ttl": "5000",
        "user.syndicate_write_ttl": "0"
    }

    # other attrs
    attr_name_base = 'foo-%s' % random_part
    attr_value_base = 'bar-%s' % random_part

    config_dir, output_dir = testlib.test_setup()
    volume_name = testlib.add_test_volume( config_dir )

    gateway_name = testlib.add_test_gateway( config_dir, volume_name, "UG", caps="ALL", email=testconf.SYNDICATE_ADMIN )
    getxattr_gateway_name = testlib.add_test_gateway( config_dir, volume_name, "UG", caps="ALL", port=31113, email=testconf.SYNDICATE_ADMIN )

    rg_gateway_name = testlib.add_test_gateway( config_dir, volume_name, "RG", caps="NONE", email=testconf.SYNDICATE_ADMIN )
    testlib.update_gateway( config_dir, rg_gateway_name, "port=31112", "driver=%s" % RG_DRIVER )

    # start the RG 
    rg_proc, rg_out_path = testlib.start_gateway( config_dir, RG_PATH, testconf.SYNDICATE_ADMIN, volume_name, rg_gateway_name )
    if not testlib.gateway_ping( 31112, 15 ):
        stop_and_save( output_dir, rg_proc, rg_out_path, "syndicate-rg")
        raise Exception("%s exited %s" % (RG_PATH, rg_proc.poll()))

    # put the file...
    exitcode, out = testlib.run( PUT_PATH, '-d2', '-f', '-c', os.path.join(config_dir, 'syndicate.conf'),
                                '-u', testconf.SYNDICATE_ADMIN, '-v', volume_name, '-g', gateway_name,
                                random_file_path, path )

    testlib.save_output( output_dir, "syndicate-put", out )

    if exitcode != 0:
    assert 'DATASET_DIR' in ag_config
    testdir = ag_config['DATASET_DIR']
    if os.path.exists(testdir):
        shutil.rmtree(testdir)

    os.makedirs(testdir)
    
    local_path = testlib.make_random_file(16384, dir=testdir)
    output_path = "/%s" % os.path.basename(local_path)
    local_fd = open(local_path, "r")
    expected_data = local_fd.read()
    local_fd.close()

    # start up AG
    AG_gateway_name = testlib.add_test_gateway( config_dir, volume_name, "AG", caps="ALL", email=testconf.SYNDICATE_ADMIN )
    testlib.update_gateway( config_dir, AG_gateway_name, "driver=%s" % AG_DRIVER )

    ag_proc, ag_out_path = testlib.start_gateway( config_dir, AG_PATH, testconf.SYNDICATE_ADMIN, volume_name, AG_gateway_name, valgrind=True )
    time.sleep(30)

    if not testlib.gateway_ping( 31111, 15 ):
        raise Exception("%s exited %s" % (AG_PATH, ag_proc.poll()))

    # create separate threads for UGs 
    for i in xrange(0, num_threads):
        t = UGThread( config_dir, output_dir, output_path, volume_name, caps="ALL", port=(31111 + i + 1), email=testconf.SYNDICATE_ADMIN )
        threads.append(t)

    # run all threads 
    for i in xrange(0, num_threads):
        threads[i].start()
Beispiel #3
0
    rmdir = os.path.join(testdir, "to_remove_1")
    os.makedirs(inner_dir)

    # put a file to publish
    local_paths = []
    for i in xrange(0, 1):
        local_path = testlib.make_random_file(16384, dir=inner_dir)
        local_paths.append(local_path)

    # start AG
    AG_gateway_name = testlib.add_test_gateway(config_dir,
                                               volume_name,
                                               "AG",
                                               caps="ALL",
                                               email=testconf.SYNDICATE_ADMIN)
    testlib.update_gateway(config_dir, AG_gateway_name, "port=31112",
                           "driver=%s" % AG_DRIVER)
    ag_proc, ag_out_path = testlib.start_gateway(config_dir,
                                                 AG_PATH,
                                                 testconf.SYNDICATE_ADMIN,
                                                 volume_name,
                                                 AG_gateway_name,
                                                 valgrind=True)
    time.sleep(30)

    if not testlib.gateway_ping(31112, 15):
        ag_exitcode, ag_out = testlib.stop_gateway(ag_proc, ag_out_path)
        testlib.save_output(output_dir, "syndicate-ag", ag_out)
        raise Exception("%s exited %s" % (AG_PATH, ag_proc.poll()))

    # should cause the AG to get updated that there's a new gateway
    ug_gateway_name = testlib.add_test_gateway(config_dir,
REMOVEXATTR_PATH = os.path.join(testconf.SYNDICATE_UG_ROOT, "syndicate-removexattr")
LISTXATTR_PATH = os.path.join(testconf.SYNDICATE_UG_ROOT, "syndicate-listxattr")

if __name__ == "__main__":
    random_part = hex(random.randint(0, 2**32-1))[2:]

    path = '/setxattr-%s' % random_part
    attr_name_base = 'foo-%s' % random_part
    attr_value_base = 'bar-%s' % random_part

    config_dir, output_dir = testlib.test_setup()
    volume_name = testlib.add_test_volume( config_dir )

    gateway_name = testlib.add_test_gateway( config_dir, volume_name, "UG", caps="ALL", email=testconf.SYNDICATE_ADMIN )
    gateway_client_name = testlib.add_test_gateway( config_dir, volume_name, "UG", caps="ALL",  email=testconf.SYNDICATE_ADMIN )
    testlib.update_gateway( config_dir, gateway_client_name, "port=31112" )

    random_part = hex(random.randint(0, 2**32-1))[2:]
   
    exitcode, out = testlib.run( TOUCH_PATH, '-d2', '-f', '-c', os.path.join(config_dir, 'syndicate.conf'),
                                '-u', testconf.SYNDICATE_ADMIN, '-v', volume_name, '-g', gateway_name,
                                path )

    testlib.save_output( output_dir, "syndicate-touch", out )

    if exitcode != 0:
        raise Exception("Failed to touch %s" % path)

    # do setxattr a few times
    # 1 attr
    exitcode, out_1attr = testlib.run( SETXATTR_PATH, '-d2', '-f', '-c', os.path.join(config_dir, 'syndicate.conf'),
Beispiel #5
0
    config_dir, output_dir = testlib.test_setup()
    volume_name = testlib.add_test_volume(config_dir)

    gateway_name = testlib.add_test_gateway(config_dir,
                                            volume_name,
                                            "UG",
                                            caps="ALL",
                                            email=testconf.SYNDICATE_ADMIN)
    gateway_client_name = testlib.add_test_gateway(
        config_dir,
        volume_name,
        "UG",
        caps="ALL",
        email=testconf.SYNDICATE_ADMIN)
    testlib.update_gateway(config_dir, gateway_client_name, "port=31112")

    random_part = hex(random.randint(0, 2**32 - 1))[2:]

    exitcode, out = testlib.run(TOUCH_PATH, '-d2', '-f', '-c',
                                os.path.join(config_dir, 'syndicate.conf'),
                                '-u', testconf.SYNDICATE_ADMIN, '-v',
                                volume_name, '-g', gateway_name, path)

    testlib.save_output(output_dir, "syndicate-touch", out)

    if exitcode != 0:
        raise Exception("Failed to touch %s" % path)

    # do setxattr a few times
    # 1 attr
Beispiel #6
0
    num_threads = 8
    threads = []

    local_path = testlib.make_random_file(16384)
    output_path = "/%s" % os.path.basename(local_path)
    local_fd = open(local_path, "r")
    expected_data = local_fd.read()
    local_fd.close()

    # start up RG
    RG_gateway_name = testlib.add_test_gateway(config_dir,
                                               volume_name,
                                               "RG",
                                               port=32110,
                                               email=testconf.SYNDICATE_ADMIN)
    testlib.update_gateway(config_dir, RG_gateway_name,
                           "driver=%s" % RG_DRIVER)

    rg_proc, rg_out_path = testlib.start_gateway(config_dir,
                                                 RG_PATH,
                                                 testconf.SYNDICATE_ADMIN,
                                                 volume_name,
                                                 RG_gateway_name,
                                                 valgrind=True)
    if not testlib.gateway_ping(32110, 15):
        raise Exception("%s exited %s" % (RG_PATH, rg_proc.poll()))

    # put the file
    put_gateway_name = testlib.add_test_gateway(config_dir,
                                                volume_name,
                                                "UG",
                                                caps="ALL",