Skip to content

Commit

Permalink
Add keys to the mysql hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
noname0443 committed Oct 8, 2024
1 parent e47b125 commit ff7f1c8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jepsen_test:
timeout 600 docker exec mysync_mysql2_1 sh -c "/var/lib/dist/base/generate_certs.sh mysync_mysql2_1.mysync_mysql_net && supervisorctl restart mysync && supervisorctl start mysqld"
timeout 600 docker exec mysync_mysql3_1 sh -c "/var/lib/dist/base/generate_certs.sh mysync_mysql3_1.mysync_mysql_net && supervisorctl restart mysync && supervisorctl start mysqld"
timeout 600 docker exec mysync_mysql1_1 setup.sh
timeout 600 bash ./tests/images/copy_keys.sh
mkdir -p ./tests/logs
(docker exec mysync_jepsen_1 /root/jepsen/run.sh > ./tests/logs/jepsen.log 2>&1 && tail -n 4 ./tests/logs/jepsen.log) || ./tests/images/jepsen_main/save_logs.sh
docker compose -p mysync -f ./tests/images/jepsen-compose.yml down --rmi all
Expand Down
14 changes: 14 additions & 0 deletions tests/images/copy_keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
for i in mysql1 mysql2 mysql3; do
docker exec mysync_${i}_1 rm /root/.ssh/id_rsa
docker exec mysync_${i}_1 ssh-keygen -m PEM -t rsa -b 2048 -N '' -C root@mysync_${i}_1 -f /root/.ssh/id_rsa
done

for i in mysql1 mysql2 mysql3; do
docker cp mysync_${i}_1:/root/.ssh/id_rsa.pub id_rsa.pub
for j in mysql1 mysql2 mysql3; do
cat id_rsa.pub
docker exec mysync_${j}_1 /bin/bash -c "echo '$(cat id_rsa.pub)' >>/root/.ssh/authorized_keys"
done
done

rm id_rsa.pub
1 change: 0 additions & 1 deletion tests/images/jepsen_common/sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
PubkeyAcceptedAlgorithms ssh-rsa
PermitRootLogin yes
MaxAuthTries 1000000

0 comments on commit ff7f1c8

Please sign in to comment.