Source code for cfme.fixtures.appliance_update

# -*- coding: utf-8 -*-
"""This module allows you to update an appliance with latest RHEL.

It has two uses:
1) If only ``--update-appliance`` is specified, it will use the YAML url.
2) If you also specify one or more ``--update-url``, it will use them instead.
import pytest

[docs]def pytest_addoption(parser): group = parser.getgroup('cfme') group.addoption( '--update-appliance', dest='update_appliance', action='store_true', default=False, help="Enable updating an appliance before the first test is run.") group.addoption( '--update-url', dest='update_urls', action='append', default=[], help="URLs to update with. If none are passed, yaml key is used.")
[docs]def pytest_sessionstart(session): if == 'master': return if not session.config.getoption("update_appliance"): return"Initiating appliance update ...") urls = session.config.getoption("update_urls")*urls, reboot=True)"Appliance update finished, waiting for UI ...")"Appliance update finished ...")