1
0
mirror of https://github.com/ubuntu/microk8s.git synced 2021-05-23 02:23:41 +03:00

Arch linux fixes and tests (#365)

This commit is contained in:
Konstantinos Tsakalozos
2019-03-25 18:57:48 +02:00
committed by GitHub
parent 247d7fc1a4
commit eb3df26005
5 changed files with 40 additions and 15 deletions

View File

@@ -36,14 +36,7 @@ skip_opt_in_config() {
arch() {
# Return the architecture we are on
local ARCH="${KUBE_ARCH:-`$SNAP/usr/bin/dpkg --print-architecture`}"
if [ "$ARCH" = "ppc64el" ]; then
ARCH="ppc64le"
elif [ "$ARCH" = "armhf" ]; then
ARCH="arm"
fi
echo $ARCH
echo $SNAP_ARCH
}

View File

@@ -148,13 +148,13 @@ parts:
- curl
- openssl
- file
- dpkg
stage-packages:
- net-tools
- util-linux
- zfsutils-linux
- socat
- iproute2
- dpkg
source: .
override-build: |
set -eu

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
pacman -S --noconfirm --needed base-devel
pacman -S --noconfirm --needed git
useradd user
echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
mkdir /home/user
chown user:user /home/user
cd /tmp
su user -c "git clone https://aur.archlinux.org/snapd.git"
su user -c "cd snapd; makepkg -si --noconfirm"
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
su user -c "git clone https://aur.archlinux.org/squashfuse-git.git"
su user -c "cd squashfuse-git; makepkg -si --noconfirm"
pacman -S --noconfirm --needed fuse3
echo "PATH=$PATH:/snap/bin" >> /etc/profile
pacman -S --noconfirm python-pip
pacman -S --noconfirm python
pip3 install -U pytest requests pyyaml
# wait for the snapd seeding to take place!
n=0
until [ $n -ge 7 ]
do
sudo snap install core && break # substitute your command here
n=$[$n+1]
sleep 10
done

View File

@@ -1,4 +1,6 @@
#!/bin/bash
set -ex
echo "--conntrack-max-per-core=0" >> /var/snap/microk8s/current/args/kube-proxy
systemctl restart snap.microk8s.daemon-proxy

View File

@@ -33,9 +33,10 @@ function create_machine() {
# Allow for the machine to boot and get an IP
sleep 20
tar cf - ./tests | lxc exec $NAME -- tar xvf - -C /tmp
lxc exec $NAME -- /bin/bash "/tmp/tests/lxc/install-deps/$DISTRO"
lxc exec $NAME -- /tmp/tests/patch-dockerd.sh
tar cf - ./tests | lxc exec $NAME -- tar xvf - -C /var/tmp
lxc exec $NAME -- /bin/bash "/var/tmp/tests/lxc/install-deps/$DISTRO"
lxc exec $NAME -- reboot
sleep 20
}
set -uex
@@ -52,14 +53,14 @@ fi
create_machine $NAME $PROXY
lxc exec $NAME -- snap install microk8s --channel=${TO_CHANNEL} --classic
lxc exec $NAME -- /tmp/tests/patch-kube-proxy.sh
lxc exec $NAME -- /var/tmp/tests/patch-kube-proxy.sh
# use 'script' for required tty: https://github.com/lxc/lxd/issues/1724#issuecomment-194416774
lxc exec $NAME -- script -e -c "pytest -s /tmp/tests/test-addons.py"
lxc exec $NAME -- script -e -c "pytest -s /var/tmp/tests/test-addons.py"
lxc exec $NAME -- microk8s.reset
lxc delete $NAME --force
NAME=machine-$RANDOM
create_machine $NAME $PROXY
# use 'script' for required tty: https://github.com/lxc/lxd/issues/1724#issuecomment-194416774
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=${TO_CHANNEL} pytest -s /tmp/tests/test-upgrade.py"
lxc exec $NAME -- script -e -c "UPGRADE_MICROK8S_FROM=${FROM_CHANNEL} UPGRADE_MICROK8S_TO=${TO_CHANNEL} pytest -s /var/tmp/tests/test-upgrade.py"
lxc delete $NAME --force