Skip to content

Commit

Permalink
Tests: Fix sideloading and repeated network-ovn tests (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
simondeziel authored Aug 9, 2024
2 parents 9cb3ac3 + 19aadd2 commit 09d91a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ For faster repeated runs, you might want to tell `snap` that it can purge the LX
without taking any snapshot:

```
export PURGE_LXD=1
./bin/local-run tests/interception latest/edge
PURGE_LXD=1 ./bin/local-run tests/interception latest/edge
```

Note: if you need to run tests on temporary machines, [Testflinger reservations](https://docs.google.com/document/d/11Kot68mnBY9Wq9DXRzTVrKpx5cMkkhBC5RrM51eyybY) might be useful.
Expand All @@ -20,8 +19,7 @@ To test a custom build of LXD, you can set the `LXD_SIDELOAD_PATH` environment v
This will be copied to `/var/snap/lxd/common/lxd.debug` and the daemon will be reloaded before the test run.

```
export LXD_SIDELOAD_PATH=/tmp/lxd
./bin/local-run tests/interception latest/edge
LXD_SIDELOAD_PATH=/tmp/lxd ./bin/local-run tests/interception latest/edge
```


Expand Down
24 changes: 9 additions & 15 deletions bin/helpers
Original file line number Diff line number Diff line change
Expand Up @@ -158,29 +158,23 @@ install_lxd() (
snap list lxd
uname -a
cat /proc/cmdline
if [ "$start_daemon" = "true" ]; then
lxd waitready --timeout=300
fi

# Silence the "If this is your first time running LXD on this machine" banner
# on first invocation
mkdir -p ~/snap/lxd/common/config/
touch ~/snap/lxd/common/config/config.yml

if [ -n "${LXD_SIDELOAD_PATH:-}" ]; then
cp "${LXD_SIDELOAD_PATH}" /var/snap/lxd/common/lxd.debug
if [ "$start_daemon" = "true" ]; then
systemctl start snap.lxd.daemon
fi
fi

if [ -n "${LXD_AGENT_SIDELOAD_PATH:-}" ]; then
mount --bind "${LXD_AGENT_SIDELOAD_PATH}" /snap/lxd/current/bin/lxd-agent
systemctl restart snap.lxd.daemon
if [ "$start_daemon" = "true" ]; then
systemctl start snap.lxd.daemon
fi
fi

if [ "$start_daemon" = "true" ]; then
lxd waitready --timeout=300
fi

# Silence the "If this is your first time running LXD on this machine" banner
# on first invocation
mkdir -p ~/snap/lxd/common/config/
touch ~/snap/lxd/common/config/config.yml
)

# hasNeededAPIExtension: check if LXD supports the needed extension.
Expand Down
3 changes: 3 additions & 0 deletions tests/network-ovn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ovs-vsctl set open_vswitch . \
external_ids:ovn-encap-type=geneve \
external_ids:ovn-encap-ip=127.0.0.1

# Empty controller log so ACL log checks are consistent over repeat runs.
echo "" > /var/log/ovn/ovn-controller.log

# Configure LXD.
lxc project switch default
lxc storage create default zfs
Expand Down

0 comments on commit 09d91a0

Please sign in to comment.