]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: allow docker-test.sh to run under root 6173/head
authorLoic Dachary <ldachary@redhat.com>
Sat, 3 Oct 2015 12:42:44 +0000 (14:42 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sat, 3 Oct 2015 12:45:58 +0000 (14:45 +0200)
Do not attempt to create a user if it is root because it already exists.

http://tracker.ceph.com/issues/13355 Fixes: #13355

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/test/centos-6/Dockerfile.in
src/test/centos-7/Dockerfile.in
src/test/debian-jessie/Dockerfile.in
src/test/fedora-21/Dockerfile.in
src/test/opensuse-13.2/Dockerfile.in
src/test/ubuntu-12.04/Dockerfile.in
src/test/ubuntu-14.04/Dockerfile.in

index a2eece88b1a7620a3d0b673ffee919ea62fd2294..6caf951b50a81374f93be88b32b64f31cbe35a81 100644 (file)
@@ -27,4 +27,4 @@ RUN yum install -y which ; cd /root ; ./install-deps.sh
 # development tools
 # nc is required to run make check on firefly only (giant+ do not use nc)
 RUN yum install -y ccache valgrind gdb git python-virtualenv gdisk kpartx hdparm jq sudo xmlstarlet parted nc
-RUN useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+RUN if test %%USER%% != root ; then useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi
index 19fe1aa099f00df500fe5916c7137fd05d598549..42810f6795f4544cd904a5d842e850b5b04ab3dc 100644 (file)
@@ -30,4 +30,4 @@ RUN cd /root ; ./install-deps.sh
 # development tools
 # nc is required to run make check on firefly only (giant+ do not use nc)
 RUN yum install -y ccache valgrind gdb git python-virtualenv gdisk kpartx hdparm jq sudo xmlstarlet parted nc
-RUN useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+RUN if test %%USER%% != root ; then useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi
index c9287bd6210df33cfdad1e0efd73036d55ece598..59f9072fdd5d304b37e9828704ec39272f7c7565 100644 (file)
@@ -28,4 +28,4 @@ RUN apt-get update
 RUN cd /root ; ./install-deps.sh
 # development tools
 RUN apt-get install -y ccache valgrind gdb python-virtualenv gdisk kpartx hdparm jq xmlstarlet
-RUN useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+RUN if test %%USER%% != root ; then useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi
index 9b606ea46f2ca229c6e391a8756530bc2b0d3ad9..7e01fab65aba50e1cd94a6e52f962541339ea8bf 100644 (file)
@@ -26,4 +26,4 @@ RUN yum install -y which ; cd /root ; ./install-deps.sh
 # development tools
 # nc is required to run make check on firefly only (giant+ do not use nc)
 RUN yum install -y ccache valgrind gdb git python-virtualenv gdisk kpartx hdparm jq sudo xmlstarlet parted nc
-RUN useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+RUN if test %%USER%% != root ; then useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi
index 85d91a2f6072b259aba03885f0536934d083c58a..20eb1814f51996105766ce65dc7df91ad0f8e479 100644 (file)
@@ -27,4 +27,4 @@ RUN cd /root ; ./install-deps.sh
 # development tools
 # nc (ncat) is required to run make check on firefly only (giant+ do not use nc)
 RUN zypper --non-interactive install ccache valgrind gdb git python-virtualenv gdisk kpartx hdparm ncat sudo xmlstarlet parted
-RUN useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+RUN if test %%USER%% != root ; then useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi
index ed55bad234efa9850a476720f27c98f22ff1bc9f..5a1c6a16fe6537fc772523a1f3052a1d6046cfba 100644 (file)
@@ -28,4 +28,4 @@ RUN apt-get update
 RUN cd /root ; ./install-deps.sh
 # development tools
 RUN apt-get install -y sudo ccache valgrind gdb python-virtualenv gdisk kpartx hdparm xmlstarlet
-RUN useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+RUN if test %%USER%% != root ; then useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi
index fddf929324dc29cf899d3e626d5aefc304292c0c..51b47ad4ae49a837b7e11f4e57519fc8541cefb3 100644 (file)
@@ -28,4 +28,4 @@ RUN apt-get update
 RUN cd /root ; ./install-deps.sh
 # development tools
 RUN apt-get install -y ccache valgrind gdb python-virtualenv gdisk kpartx hdparm jq xmlstarlet
-RUN useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+RUN if test %%USER%% != root ; then useradd -M --uid %%user_id%% %%USER%% && echo '%%USER%% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi