Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion templates/sku/setup_sku_customisations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ export TOPOLOGY_SRC_DIR="{{ __hpc_azure_resource_dir }}"
export TOPOLOGY_RUNTIME_DIR="{{ __hpc_azure_runtime_dir }}/topology"
export TOPOLOGY_GRAPH="$TOPOLOGY_RUNTIME_DIR/graph.xml"
export TOPOLOGY_FILE="$TOPOLOGY_RUNTIME_DIR/topo.xml"
mkdir -p "$TOPOLOGY_RUNTIME_DIR"

# Use the internal metadata service API to determine the type of machine and
# apply the necessary customisations for that machine.
#
# Note: for manual testing, we mock the SKU from the test environment rather
# than doing an API lookup. The API based customisation will be tested fully
# from the CI system that runs the testing on appropriate hardware.
# from the CI system that runs the testing on appropriate hardware. The CI
# system will not set __MOCK_SKU at all, so ensure that it is initialised to an
# empty string in the case where it is undefined in the environment.
: "${__MOCK_SKU:=}"
if [ -z "$__MOCK_SKU" ]; then
metadata_endpoint="http://169.254.169.254/metadata/instance?api-version=2019-06-04"

Expand Down
8 changes: 6 additions & 2 deletions templates/sku/test-sku-setup.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash -eu
#!/usr/bin/env bash
# This is a template, not an actual shell script, so tell shellcheck to
# ignore the problematic templated parts
# shellcheck disable=all
{{ ansible_managed | comment }}
{{ "system_role:hpc" | comment(prefix="", postfix="") }}
# shellcheck enable=all

# This is test code, and some operations are expected to fail. Hence we can't
# use set -e to automatically exist the script if something fails.
set -u

# Script for testing SKU customisation.
#
# This can be run in two ways, determined by the CLI parameter '--manual'
Expand Down Expand Up @@ -95,7 +99,7 @@ for sku in $SKU_LIST; do
echo
echo "Testing $sku"
if [ -n "$MANUAL_TEST" ]; then
__MOCK_SKU="$sku {{ __hpc_azure_resource_dir }}/bin/setup_sku_customisations.sh"
__MOCK_SKU="$sku" "{{ __hpc_azure_resource_dir }}/bin/setup_sku_customisations.sh"
fi

case "$sku" in
Expand Down
Loading