diff --git a/workspace_tools/host_tests/host_tests_plugins/host_test_plugins.py b/workspace_tools/host_tests/host_tests_plugins/host_test_plugins.py index a2fd7fbcd3..27b949e4dc 100644 --- a/workspace_tools/host_tests/host_tests_plugins/host_test_plugins.py +++ b/workspace_tools/host_tests/host_tests_plugins/host_test_plugins.py @@ -79,6 +79,7 @@ class HostTestPluginBase: ret = call(cmd, shell=shell) if ret: self.print_plugin_error("[ret=%d] Command: %s"% (int(ret), cmd)) + return False except Exception as e: result = False self.print_plugin_error("[ret=%d] Command: %s"% (int(ret), cmd)) diff --git a/workspace_tools/host_tests/host_tests_plugins/module_copy_shell.py b/workspace_tools/host_tests/host_tests_plugins/module_copy_shell.py index 9d57a56d30..00f79c0d87 100644 --- a/workspace_tools/host_tests/host_tests_plugins/module_copy_shell.py +++ b/workspace_tools/host_tests/host_tests_plugins/module_copy_shell.py @@ -15,6 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. """ +import os from os.path import join, basename from host_test_plugins import HostTestPluginBase @@ -25,7 +26,7 @@ class HostTestPluginCopyMethod_Shell(HostTestPluginBase): name = 'HostTestPluginCopyMethod_Shell' type = 'CopyMethod' stable = True - capabilities = ['cp', 'copy', 'xcopy'] + capabilities = ['shell', 'cp', 'copy', 'xcopy'] required_parameters = ['image_path', 'destination_disk'] def setup(self, *args, **kwargs): @@ -45,6 +46,9 @@ class HostTestPluginCopyMethod_Shell(HostTestPluginBase): # Prepare correct command line parameter values image_base_name = basename(image_path) destination_path = join(destination_disk, image_base_name) + if capabilitity == 'shell': + if os.name == 'nt': capabilitity = 'copy' + elif os.name == 'posix': capabilitity = 'cp' if capabilitity == 'cp' or capabilitity == 'copy' or capabilitity == 'copy': copy_method = capabilitity cmd = [copy_method, image_path, destination_path]