]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
test: Add script for creating test account
authorMichal Sojka <michal.sojka@cvut.cz>
Sat, 16 Nov 2019 22:15:25 +0000 (23:15 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Sat, 16 Nov 2019 22:15:25 +0000 (23:15 +0100)
tests/create-server-test-account [new file with mode: 0755]

diff --git a/tests/create-server-test-account b/tests/create-server-test-account
new file mode 100755 (executable)
index 0000000..370d31a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Creates an account needed for running some tests in ./server.wv.
+
+set -x
+set -e
+
+sudo adduser-novaboot --key ~/.ssh/id_rsa.pub --admin-id=$USER novaboot-test
+sudo chsh --shell $(realpath $(dirname $0)/../server/novaboot-shell) novaboot-test
+sudo tee /etc/sudoers.d/novaboot-test <<EOF
+$USER  ALL=(novaboot-test) NOPASSWD: ALL
+EOF