Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ __pycache__
console_*
results.json
alluredir/
allure3
ansible/host_vars
env
firmware
2 changes: 2 additions & 0 deletions targets/bananapi_bpi-r4.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
targets:
main:
features:
- wan_port
resources:
RemotePlace:
name: !template "$LG_PLACE"
Expand Down
1 change: 1 addition & 0 deletions targets/bananapi_bpi-r64.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/cznic_turris-omnia.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/genexis_pulse-ex400.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/glinet_gl-mt1300.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/glinet_gl-mt6000.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/linksys_e8450.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/openwrt_one.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
3 changes: 3 additions & 0 deletions targets/qemu-armsr-armv8.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
targets:
main:
features:
- wan_port

resources:
- NetworkService:
# The actual address will be filled in by the strategy
Expand Down
3 changes: 3 additions & 0 deletions targets/qemu-malta-be.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
targets:
main:
features:
- wan_port

resources:
- NetworkService:
# The actual address will be filled in by the strategy
Expand Down
3 changes: 3 additions & 0 deletions targets/qemu-x86-64.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
targets:
main:
features:
- wan_port

resources:
- NetworkService:
# The actual address will be filled in by the strategy
Expand Down
1 change: 1 addition & 0 deletions targets/tplink_tl-wdr3600-v1.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/tplink_tl-wdr4300-v1.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/tplink_tl-wr1043nd-v3.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
1 change: 1 addition & 0 deletions targets/tplink_tl-wr842n-v3.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
targets:
main:
features:
- wan_port
- wifi
resources:
RemotePlace:
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def pytest_addoption(parser):
parser.addoption("--firmware", action="store", default="firmware.bin")


def pytest_configure(config):
config._metadata = getattr(config, "_metadata", {})
config._metadata["version"] = "12.3.4"
config._metadata["environment"] = "staging"


def pytest_sessionfinish(session):
"""Gather all results and save them to a JSON file."""

Expand Down
12 changes: 12 additions & 0 deletions tests/test_lan.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
from ipaddress import IPv4Interface

from conftest import ubus_call


def test_lan_wait_for_network(shell_command):
for _ in range(60):
if ubus_call(shell_command, "network.interface.lan", "status").get(
"ipv4-address"
):
return

assert False, "LAN interface did not come up within 60 seconds"


def test_lan_interface_address(shell_command):
assert shell_command.get_ip_addresses("br-lan")[0] == IPv4Interface(
Expand Down
12 changes: 12 additions & 0 deletions tests/test_wan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
from conftest import ubus_call


def check_download(
Expand Down Expand Up @@ -41,6 +42,17 @@ def check_download(
command.run(f"rm {filename}")


@pytest.mark.lg_feature("wan_port")
def test_wan_wait_for_network(shell_command):
for i in range(60):
if ubus_call(shell_command, "network.interface.wan", "status").get(
"ipv4-address"
):
return

assert False, "WAN interface did not come up within 60 seconds"


@pytest.mark.lg_feature("online")
def test_https_download(ssh_command):
check_download(
Expand Down