summaryrefslogtreecommitdiff
path: root/contrib/cirrus/lib.sh
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-03-14 12:03:42 -0500
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-03-19 15:01:48 +0100
commitc6b205be77fb2a50772cd31267e09503ecd8b6bc (patch)
tree1e263d436ede974588e3b39af21955806cf19016 /contrib/cirrus/lib.sh
parentac523cbe2b257e13c7b3b823c8de83e44052ffaf (diff)
downloadpodman-c6b205be77fb2a50772cd31267e09503ecd8b6bc.tar.gz
podman-c6b205be77fb2a50772cd31267e09503ecd8b6bc.tar.bz2
podman-c6b205be77fb2a50772cd31267e09503ecd8b6bc.zip
Enable rootless integration tests
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'contrib/cirrus/lib.sh')
-rw-r--r--contrib/cirrus/lib.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index 773f4f484..fe5fe7238 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -170,30 +170,36 @@ record_timestamp() {
setup_rootless() {
req_env_var "
ROOTLESS_USER $ROOTLESS_USER
- ROOTLESS_UID $ROOTLESS_UID
- ROOTLESS_GID $ROOTLESS_GID
+ #ROOTLESS_UID $ROOTLESS_UID
+ #ROOTLESS_GID $ROOTLESS_GID
GOSRC $GOSRC
ENVLIB $ENVLIB
"
echo "creating $ROOTLESS_UID:$ROOTLESS_GID $ROOTLESS_USER user"
- groupadd -g $ROOTLESS_GID $ROOTLESS_USER
- useradd -g $ROOTLESS_GID -u $ROOTLESS_UID --no-user-group --create-home $ROOTLESS_USER
- chown -R $ROOTLESS_UID:$ROOTLESS_GID "$GOSRC"
+ #groupadd -g $ROOTLESS_GID $ROOTLESS_USER
+ #useradd -g $ROOTLESS_GID -u $ROOTLESS_UID --no-user-group --create-home $ROOTLESS_USER
+ useradd --create-home $ROOTLESS_USER
+ chown -R $ROOTLESS_USER:$ROOTLESS_USER "$GOSRC"
echo "creating ssh keypair for $USER"
ssh-keygen -P "" -f $HOME/.ssh/id_rsa
echo "Allowing ssh key for $ROOTLESS_USER"
(umask 077 && mkdir "/home/$ROOTLESS_USER/.ssh")
- chown -R $ROOTLESS_UID:$ROOTLESS_GID "/home/$ROOTLESS_USER/.ssh"
- install -o $ROOTLESS_UID -g $ROOTLESS_GID -m 0600 \
+ chown -R $ROOTLESS_USER:$ROOTLESS_USER "/home/$ROOTLESS_USER/.ssh"
+ install -o $ROOTLESS_USER -g $ROOTLESS_USER -m 0600 \
"$HOME/.ssh/id_rsa.pub" "/home/$ROOTLESS_USER/.ssh/authorized_keys"
+ # Makes debugging easier
+ cat /root/.ssh/authorized_keys >> "/home/$ROOTLESS_USER/.ssh/authorized_keys"
+
+ echo "Configuring subuid and subgid"
+ echo "${ROOTLESS_USER}:$[ROOTLESS_UID * 100]:65536" | tee -a /etc/subuid >> /etc/subgid
echo "Setting permissions on automation files"
chmod 666 "$TIMESTAMPS_FILEPATH"
echo "Copying $HOME/$ENVLIB"
- install -o $ROOTLESS_UID -g $ROOTLESS_GID -m 0700 \
+ install -o $ROOTLESS_USER -g $ROOTLESS_USER -m 0700 \
"$HOME/$ENVLIB" "/home/$ROOTLESS_USER/$ENVLIB"
echo "Configuring user's go environment variables"