Example #1
0
 def _asd( what, extra, tls = tls):
     cmd = [env['alba_bin'],
            what,
            '-h', host,
            '-p', port]
     cmd.extend(extra)
     if is_true(tls):
         alba._extend_alba_tls(cmd)
     return cmd
Example #2
0
    def list_namespaces_cmd():
        cmd = build_cmd('list-namespaces')
        tls = env['alba_tls']
        if is_true(tls):
            alba._extend_alba_tls(cmd)

        cmd.append('--to-json')
        cmd.append('2> /dev/null')
        cmd_s = ' '.join(cmd)
        return cmd_s
Example #3
0
def run_tests_disk_failures(xml=False):
    alba.demo_kill()
    alba.demo_setup()
    time.sleep(1)
    where = local
    cmd = [env['failure_tester']]
    if xml:
        cmd.append(" --xml=true")

    tls = env['alba_tls']
    if is_true(tls):
        alba._extend_alba_tls(cmd)

    cmd_s = " ".join(cmd)
    where(cmd_s)
Example #4
0
def run_tests_ocaml(xml=False,
                    kind = default_kind,
                    dump = None,
                    filter = None):
    alba.demo_kill()
    alba.arakoon_start()
    alba.wait_for_master()

    alba.maintenance_start()
    alba.proxy_start()
    alba.nsm_host_register_default()

    alba.start_osds(kind, N, False)

    tls = env['alba_tls']
    use_tls = is_true(tls)
    if use_tls:
        # make cert for extra asd (test_discover_claimed)
        alba.make_cert(name = 'test_discover_claimed')

    alba.claim_local_osds(N, abm_cfg = arakoon_config_file)

    where = local
    where("rm -rf %s/ocaml/" % ALBA_BASE_PATH)

    cmd = [env['alba_bin'], "unit-tests"]
    if xml:
        cmd.append(" --xml=true")
    if filter:
        cmd.append(" --only-test=%s" % filter)

    if use_tls:
        alba._extend_alba_tls(cmd)

    print cmd
    cmd_line = ' '.join(cmd)
    if dump:
        cmd_line += " > %s" % dump

    where(cmd_line)
Example #5
0
    def _inner():
        alba.demo_kill()
        alba.demo_setup()
        cmd = [
            env['alba_bin'],
            'create-preset', 'preset_no_compression',
            '--config', arakoon_config_file,

        ]
        tls = env['alba_tls']
        if is_true(tls):
            alba._extend_alba_tls(cmd)

        cmd.append('< ./cfg/preset_no_compression.json')
        # create the preset in albamgr
        local(" ".join(cmd))

        cmd = [
            env['alba_bin'],
            'create-namespace', 'big', 'preset_no_compression',
            '--config', arakoon_config_file
        ]
        if is_true(tls):
            alba._extend_alba_tls(cmd)
        # create new namespace with this preset
        local(" ".join(cmd))

        object_file = "%s/obj" % ALBA_BASE_PATH
        # upload a big object
        local("truncate -s 2G %s" % object_file)
        local(" ".join([
            'time', env['alba_bin'],
            'proxy-upload-object',
            "-h 127.0.0.1 ",
            'big', object_file, 'bigobj'
        ]))
        # note this may fail with NoSatisfiablePolicy from time to time

        local(" ".join([
            'time', env['alba_bin'],
            'proxy-download-object',
            "-h 127.0.0.1 ",
            'big', 'bigobj', '%s/obj_download' % ALBA_BASE_PATH
        ]))
        local("rm %s/obj_download" % ALBA_BASE_PATH)

        # policy says we can lose a node,
        # so stop and decommission osd 0 to 3
        for i in range(0,4):
            port = alba.get_osd_port(i)
            alba.osd_stop(port)
            long_id = "%i_%i_%s" % (port, 2000, alba.local_nodeid_prefix)
            cmd = [
                env['alba_bin'],
                'decommission-osd', '--long-id', long_id,
                '--config', arakoon_config_file
            ]
            if is_true(tls):
                alba._extend_alba_tls(cmd)
            local(" ".join(cmd))