Skip to content

Commit

Permalink
debug tests
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
  • Loading branch information
gabrielmougard committed Jul 15, 2024
1 parent 84b56b4 commit 5aba2ba
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 219 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ jobs:
matrix:
go: ["1.22.x"]
suite:
- "add"
- "instances"
- "basic"
- "recover"
#- "add"
#- "instances"
#- "basic"
#- "recover"
- "interactive"
- "mismatch"
- "preseed"
#- "mismatch"
#- "preseed"

steps:
- name: Performance tuning
Expand Down Expand Up @@ -229,6 +229,9 @@ jobs:
cd test
sudo --preserve-env=DEBUG,GITHUB_ACTIONS,MICROCLOUD_DEBUG_PATH,MICROCLOUDD_DEBUG_PATH,SKIP_VM_LAUNCH,SNAPSHOT_RESTORE,TEST_STORAGE_SOURCE,TESTBED_READY ./main.sh ${{ matrix.suite }}
- name: Setup tmate session because failure detected
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
documentation-checks:
uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main
with:
Expand Down
6 changes: 5 additions & 1 deletion service/lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,11 @@ func (s *LXDService) ValidateCephInterfaces(cephNetworkSubnetStr string, interfa
for _, addr := range iface.Addresses {
ip := net.ParseIP(addr)
if ip == nil {
return nil, fmt.Errorf("Invalid IP address: %v", addr)
// Attempt to parse the IP address as a CIDR.
ip, _, err = net.ParseCIDR(addr)
if err != nil {
return nil, fmt.Errorf("Could not parse either IP nor CIDR notation for address %q: %v", addr, err)
}
}

if (subnet.IP.To4() != nil && ip.To4() != nil && subnet.Contains(ip)) || (subnet.IP.To16() != nil && ip.To16() != nil && subnet.Contains(ip)) {
Expand Down
23 changes: 10 additions & 13 deletions test/includes/microcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ $(true) # workaround for set -e
fi

if [ -n "${SETUP_OVN}" ]; then
setup_ovn_underlay=""
if [ "${OVN_UNDERLAY_NETWORK}" = "yes" ]; then
setup_ovn_underlay="${OVN_UNDERLAY_NETWORK}
$(printf "wait 300ms")
${OVN_UNDERLAY_FILTER}
$(printf "select-all")
$(printf -- "---")
"
else
setup_ovn_underlay="no"
fi

setup="${setup}
${SETUP_OVN} # agree to setup OVN
${OVN_WARNING} # continue with some peers missing an interface? (yes/no)
Expand All @@ -134,9 +122,18 @@ ${IPV4_START}
${IPV4_END}
${IPV6_SUBNET}
${DNS_ADDRESSES}
${setup_ovn_underlay} # setup OVN underlay network
$(true) # workaround for set -e
"
if [ -n "${OVN_UNDERLAY_NETWORK}" ]; then
setup="${setup}
${OVN_UNDERLAY_NETWORK}
$([ "${OVN_UNDERLAY_NETWORK}" = "yes" ] && printf "wait 300ms")
${OVN_UNDERLAY_FILTER}
$([ "${OVN_UNDERLAY_NETWORK}" = "yes" ] && printf "select-all")
$([ "${OVN_UNDERLAY_NETWORK}" = "yes" ] && printf -- "---")
$(true) # workaround for set -e
"
fi
fi

# clear comments and empty lines.
Expand Down
2 changes: 1 addition & 1 deletion test/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ TEST_CURRENT_DESCRIPTION=setup
# shellcheck disable=SC2034
TEST_RESULT=failure

trap cleanup EXIT HUP INT TERM
#trap cleanup EXIT HUP INT TERM

# Import all the testsuites
import_subdir_files suites
Expand Down
Loading

0 comments on commit 5aba2ba

Please sign in to comment.