Skip to content

Commit 0bc6419

Browse files
committed
Merge branch 'release/1.8.2'
2 parents 78b6b6a + 0103b1b commit 0bc6419

File tree

4 files changed

+47
-7
lines changed

4 files changed

+47
-7
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [1.8.2](https://github.com/rdkcentral/python_raft/compare/1.8.1...1.8.2)
8+
9+
> 10 March 2026
10+
11+
- Enhance keySimulator sendKey to prevent missed keys [`#205`](https://github.com/rdkcentral/python_raft/pull/205)
12+
- Comms fixes [`#203`](https://github.com/rdkcentral/python_raft/pull/203)
13+
- Removed new line feed & updated the return result [`871cdde`](https://github.com/rdkcentral/python_raft/commit/871cdde0a490d669260e4beaa626bed4f4845ae6)
14+
- Merge tag '1.8.1' into develop [`13bf879`](https://github.com/rdkcentral/python_raft/commit/13bf87916437160f500b573c2166d68811ad7d85)
15+
716
#### [1.8.1](https://github.com/rdkcentral/python_raft/compare/1.8.0...1.8.1)
817

18+
> 8 January 2026
19+
920
- Fix #201: Corrected typo in variable name [`#202`](https://github.com/rdkcentral/python_raft/pull/202)
1021
- Merge pull request #202 from rdkcentral/feature/gh201_correct_redrat_variable_name_network_ip [`#201`](https://github.com/rdkcentral/python_raft/issues/201)
1122
- Fix #201: Corrected typo in variable name [`#201`](https://github.com/rdkcentral/python_raft/issues/201)
23+
- bumped changelog [`515826c`](https://github.com/rdkcentral/python_raft/commit/515826c51cb9737a701aa28ffcb92ede3e4a596b)
1224

1325
#### [1.8.0](https://github.com/rdkcentral/python_raft/compare/1.7.1...1.8.0)
1426

framework/core/commandModules/serialClass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,5 @@ def flush(self) -> bool:
200200
True if can successfully clear the serial console.
201201
"""
202202
self.log.info("Clearing Serial console log")
203-
self.serialCon.flushInput()
203+
self.serialCon.reset_input_buffer()
204204
return True

framework/core/commandModules/sshConsole.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,29 @@ def open(self) -> bool:
6767
"""Open the SSH session.
6868
"""
6969
try:
70-
self.console.connect(self.address, username = self.username, password = self.password, key_filename=self.key, port=self.port)
70+
# Prepare password (convert None to empty string for password-less auth)
71+
password = self.password or ''
72+
73+
# Only use key-based auth if a key file is explicitly provided
74+
if self.key:
75+
self.console.connect(
76+
self.address,
77+
username=self.username,
78+
password=password,
79+
key_filename=self.key,
80+
port=self.port
81+
)
82+
else:
83+
# No key file - use password-only auth (disable automatic key discovery)
84+
self.console.connect(
85+
self.address,
86+
username=self.username,
87+
password=password,
88+
port=self.port,
89+
look_for_keys=False, # Don't try to use SSH keys from ~/.ssh
90+
allow_agent=False # Don't try to use SSH agent
91+
)
92+
7193
self.is_open = True
7294
return True
7395
except Exception as e:

framework/core/remoteControllerModules/keySimulator.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def __init__(self, log: logModule, remoteConfig: dict):
4343
"""
4444
self.log = log
4545
self.remoteConfig = remoteConfig
46+
self.prompt = self.remoteConfig.get("prompt", ':~$ ')
4647

4748
# Initialize SSH session
4849
self.session = sshConsole(
@@ -52,7 +53,7 @@ def __init__(self, log: logModule, remoteConfig: dict):
5253
password=self.remoteConfig.get("password"),
5354
known_hosts=self.remoteConfig.get("known_hosts"),
5455
port=int(self.remoteConfig.get("port")),
55-
prompt=self.remoteConfig.get("prompt", ':~$ ')
56+
prompt=self.prompt
5657
)
5758

5859
def sendKey(self, key: str, repeat: int, delay: int):
@@ -66,11 +67,16 @@ def sendKey(self, key: str, repeat: int, delay: int):
6667
Returns:
6768
bool: Result of the command verification.
6869
"""
69-
result = False
70+
finalResult = True
7071

7172
# Send the key command
7273
for _ in range(repeat):
73-
result = self.session.write(f"keySimulator -k{key}", wait_for_prompt=True)
74+
self.session.write("")
75+
self.session.write(f"keySimulator -k{key}", wait_for_prompt=True)
7476
time.sleep(delay)
75-
76-
return result
77+
output = self.session.read_until(self.prompt, timeout=10)
78+
if self.prompt not in output:
79+
self.log.error(f"Failed to send key: {key}")
80+
finalResult = False
81+
break
82+
return finalResult

0 commit comments

Comments
 (0)