Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-22.04
Comment on lines +17 to +18
Copy link
Collaborator Author

@skshetry skshetry Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ubuntu-latest is now ubuntu-24.04, which does not support Python 3.7. See:

python-version: "3.7"
exclude:
- os: ubuntu-latest
python-version: "3.7"

steps:
- uses: actions/checkout@v1
Expand Down
7 changes: 3 additions & 4 deletions mockssh/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ def run(self):
channel = self.transport.accept()
if channel is None:
break
if channel.chanid not in self.command_queues:
self.command_queues[channel.chanid] = Queue()
t = threading.Thread(target=self.handle_client, args=(channel,))
t.daemon = True
t.start()

def handle_client(self, channel):
try:
command = self.command_queues[channel.chanid].get(block=True)
command = self.command_queues[channel.get_id()].get(block=True)
self.log.debug("Executing %s", command)
with subprocess.Popen(command, shell=True,
stdin=subprocess.PIPE,
Expand Down Expand Up @@ -77,11 +75,12 @@ def check_auth_publickey(self, username, key):
return paramiko.AUTH_FAILED

def check_channel_exec_request(self, channel, command):
self.command_queues.setdefault(channel.get_id(), Queue()).put(command)
self.command_queues[channel.get_id()].put(command)
return True

def check_channel_request(self, kind, chanid):
if kind == "session":
self.command_queues.setdefault(chanid, Queue())
return paramiko.OPEN_SUCCEEDED
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED

Expand Down