make fake network actions in dry-run mode a lot quicker

This commit is contained in:
Michael Hudson-Doyle 2016-09-27 20:52:25 +13:00
parent aa4d188d45
commit 2373837269
1 changed files with 6 additions and 6 deletions

View File

@ -229,18 +229,18 @@ class NetworkController(BaseController):
if self.opts.dry_run:
if hasattr(self, 'tried_once'):
tasks = [
('one', BackgroundProcess(['sleep', '1'])),
('two', PythonSleep(1)),
('three', BackgroundProcess(['sleep', '1'])),
('one', BackgroundProcess(['sleep', '0.1'])),
('two', PythonSleep(0.1)),
('three', BackgroundProcess(['sleep', '0.1'])),
]
else:
self.tried_once = True
tasks = [
('timeout', WaitForDefaultRouteTask(30)),
('one', BackgroundProcess(['sleep', '1'])),
('two', BackgroundProcess(['sleep', '1'])),
('one', BackgroundProcess(['sleep', '0.1'])),
('two', BackgroundProcess(['sleep', '0.1'])),
('three', BackgroundProcess(['false'])),
('four', BackgroundProcess(['sleep 1'])),
('four', BackgroundProcess(['sleep', '0.1'])),
]
else:
with open('/etc/netplan/00-snapd-config.yaml', 'w') as w: