2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright 2019 © Samsung Electronics Co., Ltd.
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 ##############################################################################
15 # install_deps() - Install dependencies required for functional tests
16 function install_deps {
17 if ! $(jq --version &>/dev/null); then
18 function ubuntu_deps {
19 sudo apt-get install -y jq
21 install_packages "" ubuntu_deps ""
25 # install_ovn_deps() - Install dependencies required for tests that require OVN
26 function install_ovn_deps {
27 if ! $(yq --version &>/dev/null); then
28 install_deps # jq needed as it's dependency of yq
29 sudo -E pip install yq
31 if ! $(ovn-nbctl --version &>/dev/null); then
32 function ovn_ubuntu_deps {
33 sudo apt-get install -y apt-transport-https
34 echo "deb https://packages.wand.net.nz $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/wand.list
35 sudo curl https://packages.wand.net.nz/keyring.gpg -o /etc/apt/trusted.gpg.d/wand.gpg
37 sudo apt install -y ovn-common
39 install_packages "" ovn_ubuntu_deps ""
43 function install_packages {
44 local suse_packages=$1
45 local ubuntu_debian_packages=$2
46 local rhel_centos_packages=$3
47 source /etc/os-release || source /usr/lib/os-release
53 ($ubuntu_debian_packages)
56 ($rhel_centos_packages)