-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathtest.sh
More file actions
27 lines (20 loc) · 728 Bytes
/
test.sh
File metadata and controls
27 lines (20 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# Run all the unit tests
# make test files read/write by all users
chmod -R a+rw /tests
# If we don't have test user created, create them
id -u csuser 2> /dev/null
if [ $? != 0 ]
then
echo "Creating user"
adduser -m --uid 9527 csuser
fi
echo "running root-level tests"
pwsh /tests/root-tests.ps1
pwsh -c "Install-Module Pester -Force -Scope AllUsers"
# Run tests as csuser with an interactive shell to verify the configuration in
# the same environment this imange will be used in. Otherwise, the .bashrc won't
# be sourced and the bash configuration (e.g., environment variables) won't be
# set during the tests.
echo "running tests as csuser"
runuser -u csuser -- /bin/bash -i -c 'pwsh /tests/test.ps1'