Verified Commit 84fe2a50 authored by Štěpán Henek's avatar Štěpán Henek 🌩

guest+lan: handle '1d' as a leasetime in uci

parent 4fc40675
Pipeline #43851 failed with stage
in 19 minutes and 48 seconds
......@@ -78,6 +78,8 @@ class LanUci(object):
return int(leasetime[:-1]) * 60
elif leasetime.endswith("h"):
return int(leasetime[:-1]) * 60 * 60
elif leasetime.endswith("d"):
return int(leasetime[:-1]) * 60 * 60 * 24
else:
return int(leasetime)
......
......@@ -392,9 +392,10 @@ def test_wrong_update(
["infinite", 0, "infinite"],
["120", 120, "120"],
["3m", 180, "180"],
["1h", 3600, "3600"],
["2h", 7200, "7200"],
["1d", 86400, "86400"],
],
ids=["none", "infinite", "120", "3m", "1h"],
ids=["none", "infinite", "120", "3m", "2h", "1d"],
)
@pytest.mark.only_backends(['openwrt'])
def test_dhcp_lease(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment