aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/bash/function
diff options
context:
space:
mode:
authorpmikus <peter.mikus@protonmail.ch>2024-02-13 13:01:54 +0100
committerpmikus <peter.mikus@protonmail.ch>2024-02-13 13:03:23 +0000
commite664d6963984e33a0efab939d83fd0f015f80fbb (patch)
tree7623cb8e7066ddb7038d291242bcc65c4161d149 /resources/libraries/bash/function
parent3797578ec4b0c4662afa44e7556d13d19e2c8e30 (diff)
feat(bootstrap): Add ability to load external NODE_FLAVOR
Signed-off-by: Peter Mikus <peter.mikus@protonmail.ch> Change-Id: Ia6e07111af543280b2365840bced02f94cf91e75
Diffstat (limited to 'resources/libraries/bash/function')
-rw-r--r--resources/libraries/bash/function/ansible.sh8
-rw-r--r--resources/libraries/bash/function/common.sh25
2 files changed, 32 insertions, 1 deletions
diff --git a/resources/libraries/bash/function/ansible.sh b/resources/libraries/bash/function/ansible.sh
index 699f028511..6cf4d16f43 100644
--- a/resources/libraries/bash/function/ansible.sh
+++ b/resources/libraries/bash/function/ansible.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -31,6 +31,9 @@ function ansible_adhoc () {
"aws" | "c6in" | "c6gn" | "c7gn")
INVENTORY_PATH="cloud_inventory"
;;
+ "x-"*)
+ INVENTORY_PATH="external_inventory"
+ ;;
*)
INVENTORY_PATH="lf_inventory"
;;
@@ -73,6 +76,9 @@ function ansible_playbook () {
"aws" | "c6in" | "c6gn" | "c7gn")
INVENTORY_PATH="cloud_inventory"
;;
+ "x-"*)
+ INVENTORY_PATH="external_inventory"
+ ;;
*)
INVENTORY_PATH="lf_inventory"
;;
diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh
index 751ee2f8dd..e08cc25bd0 100644
--- a/resources/libraries/bash/function/common.sh
+++ b/resources/libraries/bash/function/common.sh
@@ -536,6 +536,14 @@ function get_test_code () {
NODENESS="3n"
FLAVOR="alt"
;;
+ *"2n-x-"*)
+ NODENESS="2n"
+ FLAVOR="${TEST_CODE#*2n-}"
+ ;;
+ *"3n-x-"*)
+ NODENESS="3n"
+ FLAVOR="${TEST_CODE#*3n-}"
+ ;;
esac
}
@@ -974,6 +982,9 @@ function select_tags () {
*"1n-c6in" | *"2n-c6in" | *"3n-c6in")
default_nic="nic_amazon-nitro-200g"
;;
+ *"2n-x-"* | *"3n-x-"*)
+ default_nic="nic_intel-e810cq"
+ ;;
*)
default_nic="nic_intel-x710"
;;
@@ -1131,6 +1142,8 @@ function select_tags () {
*"1n-c6in" | *"2n-c6in" | *"3n-c6in")
test_tag_array+=("!ipsechw")
;;
+ *"2n-x-"* | *"3n-x-"*)
+ ;;
esac
# We will add excluded NICs.
@@ -1280,6 +1293,14 @@ function select_topology () {
TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3nb_spr_*.yaml )
TOPOLOGIES_TAGS="3_node_*_link_topo"
;;
+ "2n_x"*)
+ TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*2n_"${FLAVOR}"*.yaml )
+ TOPOLOGIES_TAGS="2_node_single_link_topo"
+ ;;
+ "3n_x"*)
+ TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n_"${FLAVOR}"*.yaml )
+ TOPOLOGIES_TAGS="3_node_single_link_topo"
+ ;;
*)
# No falling back to default, that should have been done
# by the function which has set NODENESS and FLAVOR.
@@ -1332,6 +1353,10 @@ function set_environment_variables () {
*"2n-zn2")
# Maciek's workaround for Zen2 with lower amount of cores.
export TREX_CORE_COUNT=14
+ ;;
+ *"2n-x-"* | *"3n-x-"* )
+ export TREX_CORE_COUNT=3
+ ;;
esac
}