Merge "Add --hwlb options as a command line argument for SampleVNF"
[yardstick.git] / yardstick / benchmark / scenarios / networking / sfc_tacker.bash
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2017 Ericsson AB and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 BASEDIR=`pwd`
12
13 #import VNF descriptor
14 tacker vnfd-create --vnfd-file ${BASEDIR}/test-vnfd1.yaml
15 tacker vnfd-create --vnfd-file ${BASEDIR}/test-vnfd2.yaml
16
17 #create instances of the imported VNF
18 tacker vnf-create --name testVNF1 --vnfd-name test-vnfd1
19 tacker vnf-create --name testVNF2 --vnfd-name test-vnfd2
20
21 key=true
22 while $key;do
23         sleep 3
24         active=`tacker vnf-list | grep -E 'PENDING|ERROR'`
25         echo -e "checking if SFs are up:  $active"
26         if [ -z "$active" ]; then
27                 key=false
28         fi
29 done
30
31 #create service chain
32 tacker sfc-create --name red --chain testVNF1
33 tacker sfc-create --name blue --chain testVNF2
34
35 #create classifier
36 tacker sfc-classifier-create --name red_http --chain red --match source_port=0,dest_port=80,protocol=6
37 tacker sfc-classifier-create --name red_ssh --chain red --match source_port=0,dest_port=22,protocol=6
38
39 tacker sfc-list
40 tacker sfc-classifier-list