-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from Jusuf95/astartectl_pairing_agent
Tests astartectl pairing agent commands for registration and unregistration
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# SPDX-FileCopyrightText: 2024 SECO Mind Srl | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
import subprocess | ||
|
||
|
||
def test_pairing_agent_register(astarte_env_vars): | ||
astarte_url = astarte_env_vars["astarte_url"] | ||
realm = astarte_env_vars["realm"] | ||
jwt = astarte_env_vars["jwt"] | ||
device_test_2 = astarte_env_vars["device_test_2"] | ||
|
||
arg_list = [ | ||
"astartectl", | ||
"pairing", | ||
"agent", | ||
"register", | ||
device_test_2, | ||
"-t", | ||
jwt, | ||
"-u", | ||
astarte_url, | ||
"-r", | ||
realm, | ||
] | ||
sample_data_result = subprocess.run(arg_list, capture_output=True, text=True) | ||
assert "successfully registered" in sample_data_result.stdout | ||
|
||
|
||
def test_pairing_agent_unregister(astarte_env_vars): | ||
astarte_url = astarte_env_vars["astarte_url"] | ||
realm = astarte_env_vars["realm"] | ||
jwt = astarte_env_vars["jwt"] | ||
device_test_2 = astarte_env_vars["device_test_2"] | ||
|
||
arg_list = [ | ||
"astartectl", | ||
"pairing", | ||
"agent", | ||
"unregister", | ||
device_test_2, | ||
"-t", | ||
jwt, | ||
"-u", | ||
astarte_url, | ||
"-r", | ||
realm, | ||
] | ||
sample_data_result = subprocess.run(arg_list, capture_output=True, text=True, input="y\n") | ||
assert "ok" in sample_data_result.stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters