-
Notifications
You must be signed in to change notification settings - Fork 209
tftp: add external_ip setting #1678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Just as with the `external` (path) setting, it's helpful for the DUT to know from which IP the server offers firmware. Signed-off-by: Paul Spooren <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #1678 +/- ##
======================================
Coverage 55.7% 55.8%
======================================
Files 170 170
Lines 13393 13395 +2
======================================
+ Hits 7473 7475 +2
Misses 5920 5920
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I'm running this already in my lab setup and it seems to work just fine. |
Here is an example how to use it https://github.com/aparcar/openwrt-tests/blob/main/strategies/tftpstrategy.py#L65 |
Why can't the DUT simply use the host attribute instead? |
Using a proxied setup, the host value is something like hostname-foobar, which doesn't help the tftp DUT at all. The specified IP is instead handed over via a setenv call in a custom strategy |
@Bastian-Krause any further comments? My code looks like this right now and works just fine elif status == Status.uboot:
self.transition(Status.off)
self.target.activate(self.tftp)
self.target.activate(self.console)
staged_file = self.tftp.stage(self.target.env.config.get_image_path("root"))
tftp_server_ip = self.target.get_resource(
RemoteTFTPProvider, wait_avail=False
).external_ip
self.power.cycle()
# interrupt uboot
self.uboot.init_commands = (
f"setenv bootfile {staged_file}",
) + self.uboot.init_commands
if tftp_server_ip:
tftp_dut_ip = ipaddress.ip_address(tftp_server_ip) + 1
self.uboot.init_commands = (
f"setenv serverip {tftp_server_ip}",
f"setenv ipaddr {tftp_dut_ip}",
) + self.uboot.init_commands
self.target.activate(self.uboot) |
Just as with the
external
(path) setting, it's helpful for the DUT to know from which IP the server offers firmware.Description
Checklist