cfg-checker benchmark module part 2

 - fixes for fio-runner error handling
 - fixes for web-server error handling
 - proper handling of 'scheduled_to' option
 - cleanup procedure
 - kube can wait for specific phases of svc, pod, pvc, pv

Change-Id: I9b241597e6314fed1dbc3aba5e8dee1637eea1c7
diff --git a/cfg_checker/agent/fio_runner.py b/cfg_checker/agent/fio_runner.py
index 69ec661..50afeca 100644
--- a/cfg_checker/agent/fio_runner.py
+++ b/cfg_checker/agent/fio_runner.py
@@ -270,7 +270,7 @@
                 self._fio_options_common[k] = v
             else:
                 raise CheckerException(
-                    "Error running fio: '{}'".format(self._shell_output)
+                    "Unknown option: '{}': '{}'".format(k, v)
                 )
         # recalc
         self.recalc_times()
@@ -319,11 +319,12 @@
                     _line = _bb
                 if _start < 0 and _end < 0 and not _line.startswith("{"):
                     _time = get_time()
-                    self.result[_time] = {
+                    self.results[_time] = {
                         "error": _line
                     }
                     self.eta = -1
                     self.fiorun.kill_shell()
+                    self.finished = True
                     return
                 _current = _line.splitlines()
                 _raw += _current
@@ -372,6 +373,7 @@
             _ioengines = self._shell_output
             _ioengines = _ioengines.replace("\t", "")
             _ioengines = _ioengines.splitlines()[1:]
+            self._shell_output = ""
         else:
             _ioengines = []
 
@@ -488,6 +490,11 @@
         # Reset thread if it closed
         self.fio_reset()
         # Fill options
+        if "scheduled_to" in options:
+            # just ignore it
+            _k = "scheduled_to"
+            _v = options.pop(_k)
+            logger.warning("Ignoring option: '{}': '{}'".format(_k, _v))
         self.fio.update_options(options)
         # Start it
         self.fio.start()
@@ -499,7 +506,7 @@
         # Handle scheduled time
         if "scheduled_to" not in options:
             # required parameter not set
-            return False
+            raise CheckerException("Parameter missing: 'scheduled_to'")
         else:
             # set time and get rid of it from options
             _time = options.pop("scheduled_to")