From 4c45d4b54658318f399c1366961d38398802acc9 Mon Sep 17 00:00:00 2001 From: Paller Date: Tue, 9 Nov 2021 11:32:15 +0800 Subject: [PATCH] feat: allows which agent to use, defaults to use all available agents --- src/sdg/Gauntlet.groovy | 19 ++++++++++++++++++- vars/getGauntEnv.groovy | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/sdg/Gauntlet.groovy b/src/sdg/Gauntlet.groovy index 199654da..0f84283a 100644 --- a/src/sdg/Gauntlet.groovy +++ b/src/sdg/Gauntlet.groovy @@ -774,6 +774,17 @@ def set_required_hardware(List board_names) { gauntEnv.required_hardware = board_names } +/** + * Set list of required agent for test + * @param agent_names list of strings of names of agent to use + * Strings must be associated with an existing agent. + * For example: sdg-nuc-01, master + */ +def set_required_agent(List agent_names) { + assert agent_names instanceof java.util.List + gauntEnv.required_agent = agent_names +} + /** * Set URI source. Set URI source. Supported are ip or serial * @param iio_uri_source String of URI source @@ -1017,7 +1028,13 @@ private def getOnlineAgents() { continue } if (!computer.offline) { - online_agents.add(computer.name) + if (!gauntEnv.required_agent.isEmpty()){ + if (agent in gauntEnv.required_agent){ + online_agents.add(computer.name) + } + }else{ + online_agents.add(computer.name) + } } } println(online_agents) diff --git a/vars/getGauntEnv.groovy b/vars/getGauntEnv.groovy index 324f41eb..9509ac2a 100644 --- a/vars/getGauntEnv.groovy +++ b/vars/getGauntEnv.groovy @@ -23,6 +23,7 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo agents: [], boards: [], required_hardware: [], + required_agent: [], firmware_boards: ['pluto','m2k'], enable_docker: false, docker_image: 'tfcollins/sw-ci:latest',