Setup utilities for all fixtures to use
Most of the work done in fixtures is some sort of configuration done. Every fixture have to later revert its changes (otherwise it taints environment). To make it clean as much as possible we should simplify common configuration tasks. The idea is to have objects with ability to track changes and reverting them on context leave. Imagine for example following code:
with nsfarm.setup.Setup() as setup:
setup.preserve("/etc/passwd")
board_serial.run('echo root:"{}" | chpasswd'.format(password))
yield
This is going to set root password but preserves content of /etc/passwd
so when fixture is teared down it restores original content (note that this is not a good idea but rather just an example).
We should have basic general setups handling following areas
-
Preserve files content (for arbitrary file) -
Preserve path existence/non-existence (for directories) -
UCI
More specific setups:
-
root password setup -
local time setup -
various uplink setups -
static IP -
DHCP -
PPPOE
-
-
updater setup (target branch/version/build)