tests/exit-status.sh: stub test for the SSH step's phase B rollback
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia con i test di step_firewall in tests/exit-status.sh e segui il loro schema per simulare le chiamate all’host. Aggiungi i due casi step_ssh descritti nell’issue, quindi esegui bash tests/exit-status.sh. Il lavoro è completato quando il caso di errore restituisce 1, registra la nota di rollback e chiama lo script di rollback una volta, mentre il caso di successo restituisce 0 senza chiamarlo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Why
#106 makes phase B of step_ssh() (closing the old SSH port once the operator confirmed the new one) roll back when the second restart_ssh fails. At that point the 10-minute rollback timer is already stopped, so this rollback is the only thing between a failed restart and a server with no sshd. Nothing tests it yet: tests/exit-status.sh does not run step_ssh, and the e2e VMs cannot make only the second restart fail (#127 covers the phase A paths).
Raised in the review of #106: https://github.com/exceev-consulting/server-prep/pull/106#discussion_r4418985351
What to do (after #106 is merged)
Add a block to tests/exit-status.sh, in the style of the step_firewall tests, that runs the real step_ssh with every host call replaced:
CURRENT_SSH_PORTS=22andSSH_PORT=822(so phase B runs),DRY_RUN=0,INTERACTIVE=0,BACKUP_DIRin the test's temp folder.getentreturns a home in the temp folder with one key in.ssh/authorized_keys.write_sshd_configonly setsSTEP_CHANGED=1;backup_file,runandsleepdo nothing;sshdreturns 0;ssprintsLISTEN;ufwprints nothing.restart_sshsucceeds the first time and fails the second time.bashis a function that only records its arguments, so the rollback script never really runs (remove it withunset -f bashright after).
Check that the step returns 1, that STEP_NOTES contains "phase B restart failed, rolled back", and that the rollback script was called exactly once. A second case where restart_ssh always succeeds should return 0 and never call the rollback script.
Acceptance criteria
-
bash tests/exit-status.shruns both cases and passes. - Changing the phase B line back to a bare
restart_sshmakes the test fail. - No real
systemctl,ufw,sshdor rollback script runs during the test.
- Lingua principale
- Shell
- Stelle
- 2
- Fork
- 3
- Merge medio
- 2g 14m
- PR unite (30g)
- 47
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di exceev-consulting/server-prep
-
area: docs bug claude documentation good first issue priority: low size: S triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
exceev-consulting/server-prep#225 ·
I maintainer di solito rispondono entro 2 giorni
-
area: preconfig bug claude priority: medium size: S triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
exceev-consulting/server-prep#224 ·
I maintainer di solito rispondono entro 2 giorni
-
claude enhancement priority: low size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
exceev-consulting/server-prep#222 ·
I maintainer di solito rispondono entro 2 giorni
-
e2e flake: boot fails on debian-13 when its genericcloud image is missing from SHA512SUMSForse già presa @exceev-claude l’ha presa 1 giorno fa. Apertaarea: ci bug claude priority: high size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
exceev-consulting/server-prep#212 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
server-audit.sh: flag world-writable directories in /etc such as /etc/dokploy (GHSA-qxjv-6cvh-32c6)Apertaarea: audit claude enhancement panel: dokploy priority: high security size: S triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
exceev-consulting/server-prep#211 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di exceev-consulting/server-prep
Issue simili
-
bot-found documentation priority: P3
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
madenvel/KalinkaPlayer#602 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
huggingface/kernels#1006 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
I maintainer di solito rispondono entro 2 giorni
-
severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
luainkernel/lunatik#2594 ·
I maintainer di solito rispondono entro 1 giorno