From 846fc1560ea87567397bf1945105742441f5e7c0 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 21 May 2021 11:57:42 +0200 Subject: [PATCH 1/2] test-nspawn: make run-tests idempotent Without that it's difficult to test it by running it multiple times. --- test-nspawn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-nspawn b/test-nspawn index dc005a2..3ed37b9 100755 --- a/test-nspawn +++ b/test-nspawn @@ -13,9 +13,9 @@ elif [ $1 = 'run-tests' ] then apt update apt install -y wget ca-certificates gnupg2 git ansible postgresql sudo python python3 - adduser --disabled-password --gecos "" testuser + id testuser || adduser --disabled-password --gecos "" testuser usermod -a -G sudo testuser - echo 'testuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + grep -q testuser /etc/sudoers || echo 'testuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers chown -R testuser /opt/publik-devinst /usr/bin/wget https://deb.entrouvert.org/entrouvert.gpg apt-key add entrouvert.gpg -- 2.32.0.rc0