Skip to content

Commit

Permalink
Run sshd in Containers and enable Geo-rep tests
Browse files Browse the repository at this point in the history
Started running sshd inside container as mentioned in the
following documentation

https://docs.docker.com/engine/examples/running_ssh_service/

Geo-rep tests are now running fine, reenabled those tests.

Updates: #9
Signed-off-by: Aravinda VK <[email protected]>
  • Loading branch information
aravindavk authored and amarts committed Jun 10, 2019
1 parent a2a1fa6 commit 1c39516
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
23 changes: 22 additions & 1 deletion glustertester/scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ COPY run-tests.sh /usr/share/glusterfs/
RUN chmod +x /usr/share/glusterfs/regression.sh
RUN chmod +x /usr/share/glusterfs/run-tests.sh

# SSH related things
# Based on https://docs.docker.com/engine/examples/running_ssh_service/
RUN mkdir /var/run/sshd
RUN echo 'root:gluster' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
RUN ssh-keygen -t rsa -N "" -b 4096 -f /etc/ssh/ssh_host_rsa_key

# For Geo-rep, Prepare password less ssh
RUN mkdir -p /root/.ssh
RUN rm -rf .ssh/id_rsa*
RUN ssh-keygen -N "" -f /root/.ssh/id_rsa
RUN cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys

EXPOSE 22

ARG version="(unknown)"
# Container build time (date -u '+%Y-%m-%dT%H:%M:%S.%NZ')
ARG builddate="(unknown)"
Expand All @@ -50,4 +71,4 @@ LABEL vcs-url="https://github.com/gluster/glusterfs"
LABEL vendor="gluster"
LABEL version="${version}"

ENTRYPOINT ["tail", "-f", "/dev/null"]
CMD ["/usr/sbin/sshd", "-D"]
8 changes: 0 additions & 8 deletions glustertester/scripts/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ RUN if [ "x$baseos" = "xfedora" ]; then \
python3-pyxattr iproute-tc iputils \
;fi

# For Geo-rep, Prepare password less ssh
RUN mkdir -p /root/.ssh
RUN rm -rf .ssh/id_rsa*
RUN ssh-keygen -N "" -f /root/.ssh/id_rsa
RUN cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys

ARG version="(unknown)"
# Container build time (date -u '+%Y-%m-%dT%H:%M:%S.%NZ')
ARG builddate="(unknown)"
Expand All @@ -46,5 +40,3 @@ LABEL vcs-type="git"
LABEL vcs-url="https://github.com/gluster/glusterfs"
LABEL vendor="gluster"
LABEL version="${version}"

ENTRYPOINT ["tail", "-f", "/dev/null"]
1 change: 1 addition & 0 deletions glustertester/scripts/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def run_tests(args):

cmd = ("docker exec glusterfs-tester-%d bash "
"/usr/share/glusterfs/regression.sh "
"-t 300 "
"-i /root/tests/tests-%d.dat " % (num+1, num+1)
)

Expand Down
3 changes: 0 additions & 3 deletions glustertester/scripts/split-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

def get_list_of_tests(rootdir, testdir, tests, output_prefix=None):
for testfile in os.listdir(testdir):
if testfile == "00-geo-rep":
continue

full_path = os.path.join(testdir, testfile)
if testfile.endswith(".t"):
outpath = full_path.replace(rootdir + "/", "")
Expand Down

0 comments on commit 1c39516

Please sign in to comment.