Skip to content

Commit

Permalink
jepsen fix
Browse files Browse the repository at this point in the history
  • Loading branch information
noname0443 committed Sep 13, 2024
1 parent ba47dbf commit 6a22f40
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
3 changes: 1 addition & 2 deletions tests/images/jepsen_common/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM mysync-test-base:latest
RUN (yes | ssh-keygen -t rsa -N '' -f /root/test_ssh_key -C jepsen || true) && \
RUN (yes | ssh-keygen -m PEM -t rsa -b 2048 -N '' -f /root/test_ssh_key -C root@mysync_jepsen_1 || true) && \
eval `ssh-agent -s` && cp /root/test_ssh_key.pub /root/.ssh/authorized_keys && \
cp /root/test_ssh_key.pub /root/.ssh/id_rsa.pub && \
cp /root/test_ssh_key /root/.ssh/id_rsa && ssh-add -k /root/.ssh/id_rsa

COPY ./ssh_config /etc/ssh/ssh_config
2 changes: 1 addition & 1 deletion tests/images/jepsen_main/jepsen/src/jepsen/mysync.clj
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
:name "mysync"
:os os/noop
:db (db)
:ssh {:private-key-path "/root/.ssh/id_rsa"}
:ssh {:private-key-path "/root/.ssh/id_rsa" :strict-host-key-checking :no}
:net net/iptables
:client (mysql-client nil)
:nemesis (nemesis/compose {{:start-halves :start} (nemesis/partition-random-halves)
Expand Down
20 changes: 10 additions & 10 deletions tests/images/jepsen_main/save_logs.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash

for i in 1 2 3
do
mkdir -p tests/logs/mysql${i}
mkdir -p tests/logs/zookeeper${i}
for i in 1 2 3; do
mkdir -p tests/logs/mysql${i}
mkdir -p tests/logs/zookeeper${i}

for logfile in /var/log/mysync.log /var/log/mysql/error.log /var/log/mysql/query.log /var/log/resetup.log /var/log/supervisor.log
do
logname=$(echo "${logfile}" | rev | cut -d/ -f1 | rev)
docker exec mysync_mysql${i}_1 cat "${logfile}" > "tests/logs/mysql${i}/${logname}"
done
queries=$(docker exec mysync_mysql${i}_1 bash -c 'ls /var/log/mysql/ -d /var/log/mysql/* | sed 1d')

docker exec mysync_zoo${i}_1 cat /var/log/zookeeper/zookeeper--server-mysync_zookeeper${i}_1.log > tests/logs/zookeeper${i}/zk.log 2>&1
for logfile in /var/log/mysync.log /var/log/mysql/error.log $queries /var/log/resetup.log /var/log/supervisor.log; do
logname=$(echo "${logfile}" | rev | cut -d/ -f1 | rev)
docker exec mysync_mysql${i}_1 cat "${logfile}" >"tests/logs/mysql${i}/${logname}"
done

docker exec mysync_zoo${i}_1 cat /var/log/zookeeper/zookeeper--server-mysync_zookeeper${i}_1.log >tests/logs/zookeeper${i}/zk.log 2>&1
done

tail -n 18 tests/logs/jepsen.log
Expand Down
10 changes: 10 additions & 0 deletions tests/images/jepsen_sshd_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PubkeyAuthentication yes
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
PubkeyAcceptedAlgorithms ssh-rsa
PermitRootLogin yes
MaxAuthTries 1000000
1 change: 1 addition & 0 deletions tests/images/mysql_jepsen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COPY ./setup.sh /usr/local/bin/setup.sh
COPY ./my.cnf /etc/mysql/my.cnf
COPY ./.my.cnf /root/.my.cnf
COPY ./supervisor_mysql.conf /etc/supervisor/conf.d
COPY ../jepsen_sshd_config /etc/sshd/sshd_config
RUN chown mysql:root /etc/mysql
RUN touch /etc/mysync.yaml
RUN chown mysql:mysql /etc/mysync.yaml
Expand Down
2 changes: 2 additions & 0 deletions tests/images/zookeeper_jepsen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ COPY ./supervisor_zookeeper.conf /etc/supervisor/conf.d
COPY ./retriable_path_create.sh /usr/local/bin/retriable_path_create.sh
COPY ./generate_certs_with_restart.sh /usr/local/bin/generate_certs_with_restart.sh
RUN chmod 755 /usr/local/bin/generate_certs_with_restart.sh

COPY ../jepsen_sshd_config /etc/sshd/sshd_config

0 comments on commit 6a22f40

Please sign in to comment.