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 12, 2024
1 parent 84b56b4 commit 37c8e6b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 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
2 changes: 1 addition & 1 deletion test/includes/microcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ${IPV4_START}
${IPV4_END}
${IPV6_SUBNET}
${DNS_ADDRESSES}
${setup_ovn_underlay} # setup OVN underlay network
${setup_ovn_underlay}
$(true) # workaround for set -e
"
fi
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
12 changes: 6 additions & 6 deletions test/suites/basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,21 @@ test_interactive() {
validate_system_microovn "${m}"
done

reset_systems 3 3 2
reset_systems 3 3 3

ovn_underlay_subnet_prefix="10.0.1"
ovn_underlay_subnet_iface="enp7s0"
ovn_underlay_subnet_prefix="10.3.123"
ovn_underlay_subnet_iface="enp8s0"

for n in $(seq 2 4); do
ovn_underlay_ip="${ovn_underlay_subnet_prefix}.${n}/24"
lxc exec "micro0$((n-1))" -- ip addr add "${ovn_underlay_ip}" dev "${ovn_underlay_subnet_iface}"
done

echo "Creating a MicroCloud with ZFS, OVN management network and OVN underlay network"
unset SETUP_CEPH
echo "Creating a MicroCloud with ZFS, Ceph storage with a fully disaggregated Ceph networking setup, OVN management network and OVN underlay network"
export OVN_UNDERLAY_NETWORK="yes"
export OVN_UNDERLAY_FILTER="${ovn_underlay_subnet_prefix}"
microcloud_interactive | lxc exec micro01 -- sh -c "microcloud init > out"
exit 1
microcloud_interactive | lxc exec micro01 -- sh -c "microcloud init 2>&1 tee out"

Check warning

Code scanning / shellcheck

SC2317 Warning test

Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

lxc exec micro01 -- tail -1 out | grep "MicroCloud is ready" -q

Check warning

Code scanning / shellcheck

SC2317 Warning test

Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
for m in micro01 micro02 micro03 ; do
Expand Down

0 comments on commit 37c8e6b

Please sign in to comment.