Moved test_pools to test.sh

This commit is contained in:
Tristan Ancelet 2023-11-12 18:15:55 -06:00
parent 4a2cb7b28e
commit 2916cdc102
2 changed files with 19 additions and 21 deletions

View File

@ -17,24 +17,3 @@ get_pool_ranges () {
ARRAY+=( "$RANGE" )
done <<< "$( grep -Eo $POOL_RANGE_REGEX <<< "$CONTENT" )"
}
test_pools () {
local -a POOLS
local CONTENT="${1:?"test_pools: Content not provided"}"
get_pool_declerations POOLS "$CONTENT"
for pool in ${!POOLS[@]}; do
echo "POOL: $pool"
POOL_CONTENT="${POOLS[$pool]}"
local -a RANGES
get_pool_ranges RANGES "$POOL_CONTENT"
for range in ${!RANGES[@]}; do
echo " RANGE: ${RANGES[$range]}"
done
unset RANGES
done
}

View File

@ -1,4 +1,23 @@
#!/bin/bash
test_pools () {
local -a POOLS
local CONTENT="${1:?"test_pools: Content not provided"}"
get_pool_declerations POOLS "$CONTENT"
for pool in ${!POOLS[@]}; do
echo "POOL: $pool"
POOL_CONTENT="${POOLS[$pool]}"
local -a RANGES
get_pool_ranges RANGES "$POOL_CONTENT"
for range in ${!RANGES[@]}; do
echo " RANGE: ${RANGES[$range]}"
done
unset RANGES
done
}
test_all () {
local -A SHARED_NETWORKS