Skip to content

Commit f4c0a85

Browse files
committed
tests: use mock hostname command remotely
As `hostname` is used by rcopy in tree mode via tar, mock it remotely so we can simulate multiple target nodes in tests.
1 parent 05d012f commit f4c0a85

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.github/workflows/nosetests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ jobs:
3535
run: |
3636
sed -i "1iexport CLUSTERSHELL_GW_PYTHON_EXECUTABLE=$(which python)" ~/.bashrc
3737
sed -i "2iexport PYTHONPATH=\$PYTHONPATH:$(realpath $pythonLocation/lib/python*/site-packages)" ~/.bashrc
38-
head ~/.bashrc
38+
head -2 ~/.bashrc
3939
- name: Install pdsh to test WorkerPdsh
4040
run: |
4141
sudo apt-get -y install pdsh
4242
sudo sh -c 'echo ssh > /etc/pdsh/rcmd_default'
43+
- name: Add tests/bin to remote PATH
44+
run: |
45+
sed -i "1iexport PATH=$PWD/tests/bin:\$PATH" ~/.bashrc
46+
head -1 ~/.bashrc
47+
ssh 127.0.0.2 which hostname
48+
ssh 127.0.0.2 hostname
4349
- name: Post to Slack (start)
4450
continue-on-error: true
4551
id: slack-start

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ include doc/examples/*.py
3232
include doc/examples/defaults.conf-rsh
3333
include doc/epydoc/*.conf
3434
include tests/*.py
35+
include tests/bin/*

tests/bin/hostname

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
# This is useful for simulating multiple nodes on localhost IPs,
3+
# such as 127.0.0.2, during testing scenarios.
4+
echo $SSH_CONNECTION | { IFS=' ' read -r _ _ IP _; echo "$IP"; }

0 commit comments

Comments
 (0)