From 73158a34118b18bc47433c1ba54fe38fd8712a94 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 4 Sep 2024 11:36:59 +0200 Subject: [PATCH] Fix two PTSes tests for MESH It is possible that setup has more than two PTSes available and invalid check was causing those to be skipped. Follow early return pattern as other profiles as this is future proof. --- autopts/ptsprojects/mynewt/mesh.py | 8 +++++--- autopts/ptsprojects/zephyr/mesh.py | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/autopts/ptsprojects/mynewt/mesh.py b/autopts/ptsprojects/mynewt/mesh.py index c03fdac979..8007a75e5f 100644 --- a/autopts/ptsprojects/mynewt/mesh.py +++ b/autopts/ptsprojects/mynewt/mesh.py @@ -618,8 +618,10 @@ def test_cases(ptses): tc_list.append(instance) - if len(ptses) == 2: - tc_list += test_cases_slaves - pts2 = ptses[1] + if len(ptses) < 2: + return tc_list + + tc_list += test_cases_slaves + pts2 = ptses[1] return tc_list diff --git a/autopts/ptsprojects/zephyr/mesh.py b/autopts/ptsprojects/zephyr/mesh.py index 234cee8e13..4cd8aeabe2 100644 --- a/autopts/ptsprojects/zephyr/mesh.py +++ b/autopts/ptsprojects/zephyr/mesh.py @@ -986,8 +986,10 @@ def test_cases(ptses): tc_list.append(instance) - if len(ptses) == 2: - tc_list += test_cases_slaves - pts2 = ptses[1] + if len(ptses) < 2: + return tc_list + + tc_list += test_cases_slaves + pts2 = ptses[1] return tc_list