Skip to content

Conversation

matmacieje
Copy link
Contributor

@matmacieje matmacieje commented Oct 10, 2025

OpenWrt automation: installation. boots, WiFi & Ethernet detection.

Test logs: users/mmaciejewski/OpenWrt/openwrt_os-openwrt_2025_10_14_11_25_52

@matmacieje matmacieje marked this pull request as draft October 10, 2025 13:51
Signed-off-by: Mateusz Maciejewski <[email protected]>
Crucial lab network setup added to OWR001.206 after reboot.
lib/openwrt.robot: OpenWrt library introduced.

Signed-off-by: Mateusz Maciejewski <[email protected]>
Documentation strings added/expanded.

Signed-off-by: Mateusz Maciejewski <[email protected]>
@matmacieje matmacieje force-pushed the openwrt_automation0000 branch from f2521df to a8f9f96 Compare October 14, 2025 09:51
License info added on pre-commit request.

Signed-off-by: Mateusz Maciejewski <[email protected]>
@matmacieje matmacieje marked this pull request as ready for review October 14, 2025 09:57
@matmacieje matmacieje changed the title OpenWRT automation, WiP OpenWRT automation Oct 14, 2025

# Log Out And Close Connection - elementary teardown keyword for all tests.
Suite Setup Run Keywords
... Prepare Test Suite
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we have a flag for this OS here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8feebcb

... DTS is boot via iPXE and OpenWrt image is downloaded using wget.
... OPENWRT_IMAGE_LINK - image link to download via wget
... OPENWRT_IMAGE_FILE - core of file name
... OPENWRT_TARGET_DEVICE - target drive to be wiped out using dd (!)
Copy link
Contributor

Choose a reason for hiding this comment

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

At the beginning of the test, ensure that the required variables are there (e.g. via https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Variable%20Should%20Exist)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8feebcb

Boot Dasharo Tools Suite iPXE
Enter Shell In DTS
VAR ${openwrt_image_gz}= ${OPENWRT_IMAGE_FILE} .gz separator=${EMPTY}
Remove File ${openwrt_image_gz}
Copy link
Contributor

Choose a reason for hiding this comment

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

We do not want to add it to osfv-data? We have been adding other ISOs (such as DTS and TinyCore there). Aren't we reinveinting it here?

Copy link
Contributor Author

@matmacieje matmacieje Oct 16, 2025

Choose a reason for hiding this comment

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

Moved to osfv-test-data in d1a468a
Uploaded to DTS via SSH. osfv-test-data PR: Dasharo/osfv-test-data#14

Remove File ${openwrt_image_gz}
Remove File ${OPENWRT_IMAGE_FILE}
Download File ${OPENWRT_IMAGE_LINK} ${openwrt_image_gz}
Execute Linux Command gunzip ${openwrt_image_gz}
Copy link
Contributor

@macpijan macpijan Oct 14, 2025

Choose a reason for hiding this comment

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

I often use a single command, like: gzip -cdk bootstrap-pendrive_v005.img.gz | sudo dd of=/dev/sda bs=16M (it's just an example taken from bash history)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8feebcb

Remove File ${OPENWRT_IMAGE_FILE}
Download File ${OPENWRT_IMAGE_LINK} ${openwrt_image_gz}
Execute Linux Command gunzip ${openwrt_image_gz}
Execute Linux Command dd if=${OPENWRT_IMAGE_FILE} of=/dev
Copy link
Contributor

Choose a reason for hiding this comment

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

of=/dev ? This does not look correct.

Copy link
Member

Choose a reason for hiding this comment

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

probably meant:

Suggested change
Execute Linux Command dd if=${OPENWRT_IMAGE_FILE} of=/dev
Execute Linux Command dd if=${OPENWRT_IMAGE_FILE} of=/dev/${OPENWRT_TARGET_DEVICE}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8feebcb

Execute Linux Command gunzip ${openwrt_image_gz}
Execute Linux Command dd if=${OPENWRT_IMAGE_FILE} of=/dev
Execute Linux Command sync
Power On
Copy link
Contributor

Choose a reason for hiding this comment

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

Would Execute Reboot Command work here rather than hard power cycle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8feebcb


OWR003.206 Boot operating system from disk after cold-boot (OpenWrt)
[Documentation] Boot OpenWrt from hard disk after cold-boot.
VAR @{supported_power_ctrls}= RteCtrl sonoff
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this low-level stuff in test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in d1a468a

Power On
Boot OpenWrt
Execute Command In Terminal poweroff
Power On
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure it will be warm boot? Doesn't Power On remove power from the board?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8feebcb



*** Test Cases ***
OWR001.206 Install operating system on disk (OpenWrt)
Copy link
Member

Choose a reason for hiding this comment

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

I think test case should be gated by some _INSTALLED variable, or we should check if the OS is not present yet before running it. It'd be kinda annoying to have OpenWRT install each time we re-run this test to correct a single random fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done by adding confirmation Dialog (install & desttroy data on device or skip) in 8feebcb

rtcwake static binary now provided via cloud download, simplified
Download File kw added to lib/openwrt.robot

Signed-off-by: Mateusz Maciejewski <[email protected]>
Power control logics removed, os image moved to osfv test data and
uploadet to DUT (DTS) via SSH.

Signed-off-by: Mateusz Maciejewski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants