aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/noheat/infra-openstack/vagrant/test/create_network.test
blob: d81a12fa6d3891013c283ed6698d0689fdb606a2 (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
#!/bin/sh

export NETWORK_NAME='onap_ci_lab'

export VAGRANT_CWD='..'

set_up() {
    vagrant up
    vagrant provision --provision-with=run_playbook_destroy
    vagrant provision --provision-with=run_playbook_create
}

tear_down() {
    vagrant provision --provision-with=run_playbook_destroy
}

check() {
    local net="$1"
    vagrant ssh operator --no-tty -c \
        "export OS_CLOUD=openstack; openstack network list -fcsv" \
        | grep "$net" \
        | cut -d',' -f2
}

set_up >/dev/null # drop provisioning output
check "$NETWORK_NAME"
tear_down >/dev/null # drop provisioning output