offline test: dargs in test_spec can be obmitted

If an element in test_spec does not have 'dargs', an empty dict object
will be used.

TEST=make test

Change-Id: I717afafaa32b52202f29ea40b24445cae53b5a3f
Commit-Ready: Wei-Han Chen <>
Tested-by: Wei-Han Chen <>
Reviewed-by: Chih-Yu Huang <>
diff --git a/py/test/pytests/offline_test/shell/ b/py/test/pytests/offline_test/shell/
index 8c30ccd..258f34f 100644
--- a/py/test/pytests/offline_test/shell/
+++ b/py/test/pytests/offline_test/shell/
@@ -244,10 +244,11 @@
       raise OfflineTestError('failed to make dut:%s writable' % factory_root)
     for spec in self.args.test_spec:
+      dargs = spec.get('dargs', {})
       if 'shtest_name' in spec:
-        self.builder.AddShellTestCase(spec['shtest_name'], **spec['dargs'])
+        self.builder.AddShellTestCase(spec['shtest_name'], **dargs)
       elif 'pytest_name' in spec:
-        self.builder.AddPythonTestCase(spec['pytest_name'], **spec['dargs'])
+        self.builder.AddPythonTestCase(spec['pytest_name'], **dargs)
         raise ValueError('You must specify one of `shtest_name` and '