Skip to content

Commit 322a9b8

Browse files
committed
cmd-type: default autodetect
Signed-off-by: Maximilian Deubel <[email protected]>
1 parent 68d406c commit 322a9b8

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/nrfcloud_utils/cli_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def parser_add_comms_args(parser):
210210
parser.add_argument("--rtt",
211211
help="Use RTT instead of serial. Requires device run Modem Shell sample application configured with RTT overlay",
212212
action='store_true', default=False)
213-
parser.add_argument("--cmd-type", default=CMD_TYPE_AT, choices=[CMD_TYPE_AT, CMD_TYPE_AT_SHELL, CMD_TYPE_TLS_SHELL], type=str.lower,
213+
parser.add_argument("--cmd-type", default=CMD_TYPE_AUTO, choices=[CMD_TYPE_AUTO, CMD_TYPE_AT, CMD_TYPE_AT_SHELL, CMD_TYPE_TLS_SHELL], type=str.lower,
214214
help=f"Specify the device command line type. '{CMD_TYPE_AT}' will use AT commands, '{CMD_TYPE_AT_SHELL}' will prefix AT commands with 'at ', and '{CMD_TYPE_TLS_SHELL}' will use TLS Credentials Shell commands.")
215215
parser.add_argument("--term", type=str,
216216
help="AT command termination",choices=list(CMD_TERM_DICT.keys()),

tests/test_claim_and_provision_device.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ class TestClaimAndProvisionDevice:
4545
@patch("nrfcredstore.comms.serial.Serial", return_value=FakeSerial())
4646
def test_provisioning_tags(self, ser, select_device, diap):
4747
diap.claim_device = Mock(return_value=TEST_RESPONSE)
48-
args = f"--port /not/a/real/device --api-key NOTAKEY --provisioning-tags nrf-cloud-onboarding".split()
48+
args = f"--port /not/a/real/device --cmd-type at --api-key NOTAKEY --provisioning-tags nrf-cloud-onboarding".split()
4949
# call DUT
5050
claim_and_provision_device.main(args)
5151
diap.claim_device.assert_called_once()
52+
diap.ensure_nrfcloud_provisioning_rule.assert_called_once_with("NOTAKEY", 16842753)
5253

5354
# TODO: test with local CA

tests/test_device_credentials_installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class TestDeviceCredentialsInstaller:
5151
def test_minimal_case(self, ser, select_device):
5252
with TemporaryDirectory() as tmp_dir:
5353
csv_file = os.path.join(tmp_dir, 'onboard.csv')
54-
args = f"--port /not/a/real/device --ca {TEST_CA_FILE} --ca-key {TEST_CA_KEY_FILE} --csv {csv_file} --term CRLF --sectag 52".split()
54+
args = f"--port /not/a/real/device --cmd-type at --ca {TEST_CA_FILE} --ca-key {TEST_CA_KEY_FILE} --csv {csv_file} --term CRLF --sectag 52".split()
5555
# call DUT
5656
device_credentials_installer.main(args)
5757
# check that the file was created

tests/test_gather_attestation_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class TestGatherAttestationTokens:
4242
def test_minimal_case(self, ser, select_device):
4343
with TemporaryDirectory() as tmp_dir:
4444
csv_file = os.path.join(tmp_dir, 'tokens.csv')
45-
args = f"--port /not/a/real/device --csv {csv_file}".split()
45+
args = f"--port /not/a/real/device --cmd-type at --csv {csv_file}".split()
4646
# call DUT
4747
gather_attestation_tokens.main(args)
4848
# check that the file was created

0 commit comments

Comments
 (0)