From e896190d159342d9819f0ad6f11fe01deb8eb9e5 Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 27 Aug 2012 07:35:00 +0900 Subject: add stubs for eip.checks will handle pre-init sanity checks for eip connection. some of this will actually end in more general leap-checks, but let's keep it alltogether by now. --- src/leap/eip/checks.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/leap/eip/checks.py (limited to 'src/leap/eip/checks.py') diff --git a/src/leap/eip/checks.py b/src/leap/eip/checks.py new file mode 100644 index 00000000..bb588cf7 --- /dev/null +++ b/src/leap/eip/checks.py @@ -0,0 +1,50 @@ +import logging +logger = logging.getLogger(name=__name__) + + +class EIPChecker(object): + """ + Executes all tests needed + to ensure a EIPConnection + can be sucessful + """ + def __init__(self): + pass + + def do_all_checks(self, checker=None): + """ + just runs all tests in a row. + will raise if some error encounter. + catching those exceptions is not + our responsibility at this moment + """ + if not checker: + checker = self + + # let's call all tests + # needed for a sane eip session. + + checker.dump_default_eipconfig() + checker.check_is_there_default_provider() + checker.fetch_definition() + checker.fetch_eip_config() + checker.check_complete_eip_config() + checker.ping_gateway() + + def dump_default_eipconfig(self): + raise NotImplementedError + + def check_is_there_default_provider(self): + raise NotImplementedError + + def fetch_definition(self): + raise NotImplementedError + + def fetch_eip_config(self): + raise NotImplementedError + + def check_complete_eip_config(self): + raise NotImplementedError + + def ping_gateway(self): + raise NotImplementedError -- cgit v1.2.3