Addresses requests to make it easier to avoid conflicts between the
Horizon dashboard and http services that might already be running on
the machine.
Configurable via snap config. Exposing via arguments to .init and
testing post init configuration is left for a separate PR.
Eventually, these may move to non standard ports by default. This PR
sets the stage for that, but further discussion is needed before we
decide whether to implement.
(This commit also contains a sneaky fix for the username display at the
end of the launch script.)
This change prevents builds in the gate from timing out while pulling
the iptables part, which was happening with increasing frequency.
The part was originally added in an attempt to isolate ourselves
better from the host system, despite being classically confined. This
approach was unreliable -- it doesn't work particularly well for
commands requiring sudo. We can back off this change (especially since
we've removed the special pathing that pointed us at the snapcraft
built iptables anyway -- I think that the part is superfluous).
In addition to the automated tests, I have verified that the following
work:
1. xenial and eoan installs
2. clustering
3. refresh from beta and edge
Broke default config settings into a separate script, which the
install hook always called, and post-refresh calls if it can't find
the new config hierarchy.
When refreshing a snap, set-br-ex could fail because the iptables
rules that it sets were already setup. We now exit zero if this is
true, which prevents us from breaking on upgrades.
Refactored test framework so that we have more flexibility in terms of
installing various versions of microstack before and after running
some tests. Moved in class "globals" into per instance variables,
to avoid broken cases with incomplete cleanup.
Added test_refresh.py, plus matching env in tox.
Refresh tests will fail currently, because we have some pending issues
that break refreshes. Fixing those is a subject for a different
commit.
Refactored cluster_test.py and control_test.py to use new framework.
Should (and do) pass.
Framework now cleans up multipass hosts regardless of whether or not
the tests passed. Leaning on the .tar.gz for local troubleshooting
helps us make it better for in gate troubleshooting.
Delay creating external bridge until we are initializing
Previously, the snap set up a bridge using the default 10.20.20.0/24
network upon install. If there was a good reason not to use this
network (e.g., it already exists and is being used for another
purpose), MicroStack, and the host machine, could wind up in a broken
state.
This PR delays setting up the bridge until after we have given an
operator a chance to override the default settings.
This has been manually tested. To test, do the following:
1) Checkout the code, and run tox -e build
2) Run tools/make-a-microstack.sh
3) snapctl set config.network.ext-cidr and config.network.ext-gateway
4) Run microstack_init
5) Exit the snap shell and run microstack.launch