cfg-checker bench part 1

 - first single test debug portion
 - updated fio option extraction
 - updated date interaction
 - fixed agent error showing and handling

 Related-PROD: PROD-36669

Change-Id: I7c1014c01b5b84429f112bff8db5ad34944c4644
diff --git a/cfg_checker/agent/fio_runner.py b/cfg_checker/agent/fio_runner.py
index f1cecab..69ec661 100644
--- a/cfg_checker/agent/fio_runner.py
+++ b/cfg_checker/agent/fio_runner.py
@@ -19,6 +19,38 @@
 
 
 _datetime_fmt = "%m/%d/%Y, %H:%M:%S"
+fio_options_common = {
+    "name": "agent_run",
+    "filename": "/cephvol/testfile",
+    "status-interval": "500ms",
+    "randrepeat": 0,
+    "verify": 0,
+    "direct": 1,
+    "gtod_reduce": 0,
+    "bs": "32k",
+    "iodepth": 16,
+    "size": "10G",
+    "readwrite": "randrw",
+    "ramp_time": "5s",
+    "runtime": "30s",
+    "ioengine": "libaio"
+}
+
+fio_options_seq = {
+    "numjobs": 1,
+    "offset_increment": "500M"
+}
+fio_options_mix = {
+    "rwmixread": 50
+}
+
+
+def get_fio_options():
+    # Duplicate function for external option access
+    _opts = deepcopy(fio_options_common)
+    _opts.update(deepcopy(fio_options_seq))
+    _opts.update(deepcopy(fio_options_mix))
+    return _opts
 
 
 def output_reader(_stdout, outq):
@@ -141,37 +173,16 @@
         "--thread"
     ]
 
-    _fio_options_common = {
-        "name": "agent_run",
-        "filename": "/tmp/testfile",
-        "status-interval": "500ms",
-        "randrepeat": 0,
-        "verify": 0,
-        "direct": 1,
-        "gtod_reduce": 0,
-        "bs": "32k",
-        "iodepth": 16,
-        "size": "10G",
-        "readwrite": "randrw",
-        "ramp_time": "5s",
-        "runtime": "30s",
-        "ioengine": "libaio"
-    }
-
-    _fio_options_seq = {
-        "numjobs": 1,
-        "offset_increment": "500M"
-    }
-    _fio_options_mix = {
-        "rwmixread": 50
-    }
+    _fio_options_common = fio_options_common
+    _fio_options_seq = fio_options_seq
+    _fio_options_mix = fio_options_mix
 
     eta_sec = 0
     total_time_sec = 0
     elapsed_sec = 0
     testrun = {}
 
-    mount_point = "/tmp"
+    mount_point = "/cephvol"
     filename = "testfile"
 
     # test modes: 'randread', 'randwrite', 'read', 'write', 'randrw'
@@ -229,7 +240,14 @@
             self.fio_version = self._shell_output
         # all outputs timeline
         self.timeline = {}
-
+        # setup target file
+        if not os.path.exists(self.mount_point):
+            logger.warning(
+                "WARNING: '{}' not exists, using tmp folder".format(
+                    self.mount_point
+                )
+            )
+            self.mount_point = "/tmp"
         self._fio_options_common["filename"] = os.path.join(
             self.mount_point,
             self.filename
@@ -484,7 +502,11 @@
             return False
         else:
             # set time and get rid of it from options
-            self.fio.scheduled_datetime = options.pop("scheduled_to")
+            _time = options.pop("scheduled_to")
+            self.fio.scheduled_datetime = datetime.strptime(
+                _time,
+                _datetime_fmt
+            )
         # Fill options
         self.fio.update_options(options)
         # Start it
@@ -594,7 +616,9 @@
     _opts["readwrite"] = "read"
     _opts["ramp_time"] = "1s"
     _opts["runtime"] = "10s"
-    _opts["scheduled_to"] = datetime.now() + timedelta(seconds=12)
+    _opts["scheduled_to"] = (datetime.now() + timedelta(seconds=12)).strftime(
+        _datetime_fmt
+    )
     _shell.do_scheduledrun(_opts)
     _shell()
     _times = _shell.get_resultlist()