-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move and rename SSH master socket path to avoid path length limit (#3196
) Putting SSH sockets into plan directory is nice and all, no chance to re-use socket by mistake, no conflicts, but it turns out SSH will not accept path longer than 104 characters. Or 108, depending who you ask. So, moving sockets once again, this time then live in *run* workdir, they no longer contain plan name, because that can be very long, and we have two fallbacks: * if the path is too long, we use `hashlib` and create less readable, but hopefully shorter name, and * if the path is still too long, SSH multiplexing is disabled completely.
- Loading branch information
Showing
6 changed files
with
141 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
execute: | ||
how: tmt | ||
|
||
discover: | ||
how: shell | ||
tests: | ||
- name: smoke | ||
test: /bin/true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
summary: Check that SSH multiplexing works as expected | ||
tag+: | ||
- provision-only | ||
- provision-connect | ||
- provision-virtual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
rlRun "PROVISION_HOW=${PROVISION_HOW:-virtual}" | ||
rlRun "run=\$(mktemp -d)" 0 "Create run directory" | ||
rlRun "long_run=\$(mktemp -d /tmp/tmp.veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongXXX)" 0 "Create run directory with a very long name" | ||
rlRun "pushd data" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "SSH multiplexing should be enabled by default ($PROVISION_HOW)" | ||
rlRun "tmt -vv run -i $run -a provision -h $PROVISION_HOW" | ||
rlAssertGrep "Spawning the SSH master process" "$run/log.txt" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "SSH multiplexing should be disabled when SSH socket path gets too long ($PROVISION_HOW)" | ||
rlRun "tmt -vv run -i $long_run -a provision -h $PROVISION_HOW" | ||
rlAssertGrep "warn: SSH multiplexing will not be used because the SSH socket path '.*' is too long." "$long_run/log.txt" | ||
rlAssertGrep "The SSH master process cannot be terminated because it is disabled." "$long_run/log.txt" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
rlRun "rm -r $run" 0 "Remove run directory" | ||
rlRun "rm -r $long_run" 0 "Remove run directory with the long name" | ||
rlPhaseEnd | ||
rlJournalEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters