Exemplo n.º 1
0
    def deploy_and_test(old_proxy, old_plugins, old_asds):
        tls = 'False'

        alba.demo_kill()

        env_old = env.copy()
        old_alba_home = './bin/0.6'
        env_old['alba_bin'] = env.get('alba.0.6')
        env_old['alba_plugin_path'] = env.get('ALBA_06_PLUGIN_PATH', '/usr/lib/alba')
        env_old['license_file'] = '%s/community_license' % old_alba_home
        env_old['signature']    = '''3cd787f7a0bcb6c8dbf40a8b4a3a5f350fa87d1bff5b33f5d099ab850e44aaeca6e3206b595d7cb361eed28c5dd3c0f3b95531d931a31a058f3c054b04917797b7363457f7a156b5f36c9bf3e1a43b46e5c1e9ca3025c695ef366be6c36a1fc28f5648256a82ca392833a3050e1808e21ef3838d0c027cf6edaafedc8cfe2f2fc37bd95102b92e7de28042acc65b8b6af4cfb3a11dadce215986da3743f1be275200860d24446865c50cdae2ebe2d77c86f6d8b3907b20725cdb7489e0a1ba7e306c90ff0189c5299194598c44a537b0a460c2bf2569ab9bb99c72f6415a2f98c614d196d0538c8c19ef956d42094658dba8d59cfc4a024c18c1c677eb59299425ac2c225a559756dee125ef93c38c211cda69c892d26ca33b7bd2ca95f15bbc1bb755c46574432005b8afcab48a0a5ed489854cec24207cddc7ab632d8715c1fb4b1309b45376a49e4c2b4819f27d9d6c8170c59422a0b778b9c3ac18e677bc6fa6e2a2527365aca5d16d4bc6e22007debef1989d08adc9523be0a5d50309ef9393eace644260345bb3d442004c70097fffd29fe315127f6d19edd4f0f46ae2f10df4f162318c4174b1339286f8c07d5febdf24dc049a875347f6b2860ba3a71b82aba829f890192511d6eddaacb0c8be890799fb5cb353bce7366e8047c9a66b8ee07bf78af40b09b4b278d8af2a9333959213df6101c85dda61f2944237c8'''
        env_old['arakoon_bin'] = env.get('ARAKOON_189_BIN', '/usr/bin/arakoon')
        if old_plugins:
            arakoon_env = env_old
        else:
            arakoon_env = env

        alba.demo_kill(env = env_old)

        alba.arakoon_start(env = arakoon_env)
        alba.wait_for_master(env = arakoon_env)

        if old_plugins:
            cmd = [
                env_old['alba_bin'],
                'apply-license',
                env_old['license_file'],
                env_old['signature'],
                '--config', arakoon_config_file
            ]
            cmd_line = ' '.join(cmd)
            local(cmd_line)

        alba.maintenance_start()

        proxy_env = env_old if old_proxy else env

        alba.proxy_start(env = proxy_env)


        alba.nsm_host_register_default()


        if old_asds:
            asd_env = env_old
        else:
            asd_env = env

        kind = default_kind
        alba.start_osds(kind, N, False, env = asd_env)
        alba.claim_local_osds(N, abm_cfg = arakoon_config_file)
        alba.create_namespace_demo()
        #
        test(old_proxy, old_plugins, old_asds)
Exemplo n.º 2
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)