summaryrefslogtreecommitdiffstats
path: root/tests/lib/installer
blob: 807023f3c4d7f1c8f1fa14573e8ca16ad316caa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

INSTALLER_TYPE=${INSTALLER_TYPE:-local}
INSTALLER_IP=${INSTALLER_IP:-none}
ssh_opts_cpu="$ssh_opts"

function is_installer_supported {
    local installer="$1"
    [[ -f $TOP_DIR/lib/installers/$installer ]]
}

function is_installer {
    local installer="$1"
    [[ $installer == $INSTALLER_TYPE ]]
}

function setup_installer {
    if ! is_set INSTALLER_IP; then
        get_installer_ip
    fi

    installer_get_ssh_keys
    installer_apply_patches
}

function cleanup_installer {
    cleanup_installer_$INSTALLER_TYPE
}


if ! is_installer_supported $INSTALLER_TYPE; then
    die $LINENO"INSTALLER_TYPE=$INSTALLER_TYPE is not supported."
fi

source $TOP_DIR/lib/installers/$INSTALLER_TYPE