force abspath for path options

Deeper in the code, a chdir occurs- it shouldn't, but rather than
try to keep people behaving, just convert any given path to absolute.

BUG=None
TEST=ctest --target_image my-image.bin

Change-Id: I53e0ee89d1d65c85168176d21b112521b9c165b6
Reviewed-on: https://gerrit.chromium.org/gerrit/13563
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
diff --git a/ctest/ctest.py b/ctest/ctest.py
index e671c9f..a9fd336 100755
--- a/ctest/ctest.py
+++ b/ctest/ctest.py
@@ -297,6 +297,13 @@
   if args: parser.error('Extra args found %s.' % args)
   if not options.board: parser.error('Need board for image to compare against.')
 
+  # force absolute path for these options, since a chdir occurs deeper in the
+  # codebase.
+  for x in ('nplus1_archive_dir', 'target_image', 'test_results_root'):
+    val = getattr(options, x)
+    if val is not None:
+      setattr(options, x, os.path.abspath(val))
+
   ctest = CTest(options)
   if ctest.sign_payloads: ctest.GeneratePublicKey()
   ctest.FindTargetAndBaseImages()