xci: scripts: vm: Install additional packages to clean VM 61/51361/2
authorMarkos Chandras <mchandras@suse.de>
Tue, 30 Jan 2018 16:59:16 +0000 (16:59 +0000)
committerMarkos Chandras <mchandras@suse.de>
Thu, 1 Feb 2018 09:34:08 +0000 (09:34 +0000)
Install some additional packages to the clean VM which can be useful
during debugging. Moreover, we move the common distribution packages
into a variable in order to simplify the code a little bit.

Change-Id: I0405820900a15fec730a2bbfc95a1d1f3485bf0f
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/scripts/vm/start-new-vm.sh

index 3048d1b..e5a13b6 100755 (executable)
@@ -112,15 +112,17 @@ if ! sudo -n "true"; then
        exit 1
 fi
 
+COMMON_DISTRO_PKGS=(vim strace gdb htop dnsmasq docker iptables ebtables virt-manager qemu-kvm)
+
 case ${ID,,} in
        *suse)
-               pkg_mgr_cmd="sudo zypper -q -n install virt-manager qemu-kvm qemu-tools libvirt-daemon docker libvirt-client libvirt-daemon-driver-qemu iptables ebtables dnsmasq"
+               pkg_mgr_cmd="sudo zypper -q -n install ${COMMON_DISTRO_PKGS[@]} qemu-kvm qemu-tools libvirt-daemon libvirt-client libvirt-daemon-driver-qemu"
                ;;
        centos)
-               pkg_mgr_cmd="sudo yum install -q -y epel-release && sudo yum install -q -y in virt-manager qemu-kvm qemu-kvm-tools qemu-img libvirt-daemon-kvm docker iptables ebtables dnsmasq"
+               pkg_mgr_cmd="sudo yum install -q -y epel-release && sudo yum install -q -y in ${COMMON_DISTRO_PKGS[@]} qemu-kvm-tools qemu-img libvirt-daemon-kvm"
                ;;
        ubuntu)
-               pkg_mgr_cmd="sudo apt-get install -y -q=3 virt-manager qemu-kvm libvirt-bin qemu-utils docker.io docker iptables ebtables dnsmasq"
+               pkg_mgr_cmd="sudo apt-get install -y -q=3 ${COMMON_DISTRO_PKGS[@]} libvirt-bin qemu-utils docker.io"
                ;;
 esac