add smoke test for configure via yaml file

This commit is contained in:
Mike Kinney
2021-12-06 14:23:02 -08:00
parent 291e235e34
commit 516082e2d3
3 changed files with 29 additions and 2 deletions

View File

@@ -126,6 +126,15 @@ Setting HAM ID to KI1345 and turning off encryption
Writing modified channels to device
```
## Changing multiple settings from a yaml file
You can put parameters into a yaml file to update multiple values. See the example_config.yml.
This is how you might call it:
```
meshtastic --configure example_config.yaml
```
## FAQ/common problems
This is a collection of common questions and answers from our friendly forum.

View File

@@ -9,7 +9,7 @@ location:
user_prefs:
region: 1
is_always_powered: true
is_always_powered: 'true'
send_owner_interval: 2
screen_on_secs: 31536000
wait_bluetooth_secs: 31536000
wait_bluetooth_secs: 31536000

View File

@@ -321,6 +321,24 @@ def test_smoke1_seturl_invalid_url():
assert re.search('Aborting', out, re.MULTILINE)
@pytest.mark.smoke1
def test_smoke1_configure():
"""Test --configure"""
return_value, out = subprocess.getstatusoutput(f"meshtastic --configure example_config.yaml")
assert re.match(r'Connected to radio', out)
assert re.search('^Setting device owner to Bob TBeam', out, re.MULTILINE)
assert re.search('^Fixing altitude at 304 meters', out, re.MULTILINE)
assert re.search('^Fixing latitude at 35.8', out, re.MULTILINE)
assert re.search('^Fixing longitude at -93.8', out, re.MULTILINE)
assert re.search('^Setting device position', out, re.MULTILINE)
assert re.search('^Set region to 1', out, re.MULTILINE)
assert re.search('^Set is_always_powered to true', out, re.MULTILINE)
assert re.search('^Set send_owner_interval to 2', out, re.MULTILINE)
assert re.search('^Set screen_on_secs to 31536000', out, re.MULTILINE)
assert re.search('^Set wait_bluetooth_secs to 31536000', out, re.MULTILINE)
assert re.search('^Writing modified preferences to device', out, re.MULTILINE)
@pytest.mark.smoke1
def test_smoke1_factory_reset():
"""Test factory reset"""