rtems-proxy 1.3.0b2__tar.gz → 1.3.0b3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/PKG-INFO +1 -1
- rtems_proxy-1.3.0b3/rtems-proxy.code-workspace +14 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/_version.py +3 -3
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/telnet.py +32 -28
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy.egg-info/PKG-INFO +1 -1
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy.egg-info/SOURCES.txt +1 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.copier-answers.yml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.devcontainer/devcontainer.json +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/CONTRIBUTING.md +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/ISSUE_TEMPLATE/issue.md +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/copilot-instructions.md +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/pages/index.html +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/pages/make_switcher.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/workflows/_container.yml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/workflows/_dist.yml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/workflows/_pypi.yml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/workflows/_release.yml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/workflows/_test.yml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/workflows/_tox.yml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/workflows/ci.yml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.gitignore +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.gitleaks.toml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.pre-commit-config.yaml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.python-version +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.vscode/extensions.json +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.vscode/launch.json +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.vscode/settings.json +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.vscode/tasks.json +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/Dockerfile +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/LICENSE +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/README.md +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/pyproject.toml +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/renovate.json +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/requirements.txt +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/setup.cfg +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/__init__.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/__main__.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/configure.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/copy.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/globals.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/rsync.sh.jinja +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/trace.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy/utils.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy.egg-info/requires.txt +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/src/rtems_proxy.egg-info/top_level.txt +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/tests/conftest.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/tests/test_cli.py +0 -0
- {rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/uv.lock +0 -0
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '1.3.
|
|
32
|
-
__version_tuple__ = version_tuple = (1, 3, 0, '
|
|
31
|
+
__version__ = version = '1.3.0b3'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 3, 0, 'b3')
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g4ee61374d'
|
|
@@ -89,7 +89,7 @@ class TelnetRTEMS:
|
|
|
89
89
|
report("Cannot connect to remote IOC, connection in use?")
|
|
90
90
|
raise CannotConnectError
|
|
91
91
|
|
|
92
|
-
def check_prompt(self, retries
|
|
92
|
+
def check_prompt(self, retries) -> RtemsState:
|
|
93
93
|
"""
|
|
94
94
|
Determine if we are currently seeing an IOC shell prompt or
|
|
95
95
|
bootloader. Because there is a possibility that we are in the middle
|
|
@@ -97,7 +97,7 @@ class TelnetRTEMS:
|
|
|
97
97
|
"""
|
|
98
98
|
assert self._child, "must call connect before check_prompt"
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
for retry in range(retries):
|
|
101
101
|
try:
|
|
102
102
|
# see if we are in the IOC shell
|
|
103
103
|
sleep(0.5)
|
|
@@ -118,8 +118,7 @@ class TelnetRTEMS:
|
|
|
118
118
|
report("Currently in IOC shell")
|
|
119
119
|
return RtemsState.IOC
|
|
120
120
|
|
|
121
|
-
report("
|
|
122
|
-
retries -= 1
|
|
121
|
+
report(f"Retry {retry + 1} of get current status")
|
|
123
122
|
|
|
124
123
|
report("Current state UNKNOWN")
|
|
125
124
|
raise CannotConnectError("Current state of remote IOC unknown")
|
|
@@ -132,13 +131,13 @@ class TelnetRTEMS:
|
|
|
132
131
|
assert self._child, "must call connect before reboot"
|
|
133
132
|
|
|
134
133
|
report(f"Rebooting into {into.name}")
|
|
135
|
-
current_state = self.check_prompt()
|
|
134
|
+
current_state = self.check_prompt(retries=2)
|
|
136
135
|
if current_state == RtemsState.MOT:
|
|
137
136
|
self._child.sendline("reset")
|
|
138
137
|
else:
|
|
139
138
|
self._child.sendline("exit")
|
|
140
139
|
|
|
141
|
-
self._child.expect(self.CONTINUE, timeout=
|
|
140
|
+
self._child.expect(self.CONTINUE, timeout=30)
|
|
142
141
|
if into == RtemsState.MOT:
|
|
143
142
|
# send escape to get into the bootloader
|
|
144
143
|
self._child.sendline(chr(27))
|
|
@@ -146,15 +145,7 @@ class TelnetRTEMS:
|
|
|
146
145
|
# send space to boot the IOC
|
|
147
146
|
self._child.send(" ")
|
|
148
147
|
|
|
149
|
-
def
|
|
150
|
-
if self._child is None:
|
|
151
|
-
raise RuntimeError("Connection not established")
|
|
152
|
-
expects: list[str] = self.FAIL_STRINGS + [self.IOC_STARTED]
|
|
153
|
-
index = self._child.expect(expects, timeout=timeout) # type: ignore[arg-type]
|
|
154
|
-
if index != len(self.FAIL_STRINGS):
|
|
155
|
-
raise RuntimeError(f"IOC boot failed - output included '{expects[index]}'")
|
|
156
|
-
|
|
157
|
-
def get_epics_prompt(self):
|
|
148
|
+
def get_epics_prompt(self, retries=5):
|
|
158
149
|
"""
|
|
159
150
|
Get to the IOC shell prompt, if the IOC is not already running, reboot
|
|
160
151
|
it into the IOC shell. If the IOC is running, do a reboot only if
|
|
@@ -162,17 +153,18 @@ class TelnetRTEMS:
|
|
|
162
153
|
"""
|
|
163
154
|
assert self._child, "must call connect before get_epics_prompt"
|
|
164
155
|
|
|
165
|
-
current = self.check_prompt()
|
|
166
|
-
|
|
167
|
-
|
|
156
|
+
current = self.check_prompt(retries=10)
|
|
157
|
+
|
|
158
|
+
if current != RtemsState.IOC or (self._ioc_reboot and not self.ioc_rebooted):
|
|
159
|
+
sleep(0.5)
|
|
160
|
+
report("Rebooting the IOC")
|
|
161
|
+
|
|
168
162
|
self.reboot(RtemsState.IOC)
|
|
169
163
|
self.ioc_rebooted = True
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if
|
|
173
|
-
|
|
174
|
-
self.reboot(RtemsState.IOC)
|
|
175
|
-
self.wait_epics_prompt()
|
|
164
|
+
|
|
165
|
+
current = self.check_prompt(retries=10)
|
|
166
|
+
if current != RtemsState.IOC:
|
|
167
|
+
raise CannotConnectError("Failed to reboot into IOC shell")
|
|
176
168
|
|
|
177
169
|
def get_boot_prompt(self):
|
|
178
170
|
"""
|
|
@@ -181,7 +173,7 @@ class TelnetRTEMS:
|
|
|
181
173
|
"""
|
|
182
174
|
assert self._child, "must call connect before get_boot_prompt"
|
|
183
175
|
|
|
184
|
-
current = self.check_prompt()
|
|
176
|
+
current = self.check_prompt(retries=10)
|
|
185
177
|
if current != RtemsState.MOT:
|
|
186
178
|
# get out of the IOC and return to MOT
|
|
187
179
|
self.reboot(RtemsState.MOT)
|
|
@@ -203,6 +195,18 @@ class TelnetRTEMS:
|
|
|
203
195
|
assert self._child, "must call connect before expect"
|
|
204
196
|
self._child.expect(pattern, timeout=timeout)
|
|
205
197
|
|
|
198
|
+
def flush_remaining_output(self) -> None:
|
|
199
|
+
"""
|
|
200
|
+
Flush any remaining buffered output to stdout.
|
|
201
|
+
Useful for displaying output before error reporting.
|
|
202
|
+
"""
|
|
203
|
+
try:
|
|
204
|
+
if self._child:
|
|
205
|
+
self._child.read_nonblocking(size=8192, timeout=0.5)
|
|
206
|
+
except (pexpect.exceptions.TIMEOUT, pexpect.exceptions.EOF):
|
|
207
|
+
# no more output available, which is fine
|
|
208
|
+
pass
|
|
209
|
+
|
|
206
210
|
def close(self):
|
|
207
211
|
if self._child:
|
|
208
212
|
self._child.close()
|
|
@@ -243,7 +247,7 @@ def ioc_connect(
|
|
|
243
247
|
telnet.sendline("\r")
|
|
244
248
|
|
|
245
249
|
if reboot:
|
|
246
|
-
telnet.get_epics_prompt()
|
|
250
|
+
telnet.get_epics_prompt(retries=10)
|
|
247
251
|
else:
|
|
248
252
|
report("Auto reboot disabled. Skipping reboot")
|
|
249
253
|
|
|
@@ -253,8 +257,8 @@ def ioc_connect(
|
|
|
253
257
|
raise
|
|
254
258
|
|
|
255
259
|
except Exception as e:
|
|
256
|
-
#
|
|
257
|
-
telnet.
|
|
260
|
+
# flush any remaining buffered output to stdout
|
|
261
|
+
telnet.flush_remaining_output()
|
|
258
262
|
report(f"An error occurred: {e}")
|
|
259
263
|
telnet.close()
|
|
260
264
|
if raise_errors:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rtems_proxy-1.3.0b2 → rtems_proxy-1.3.0b3}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|