diff --git a/xCAT-test/autotest/bundle/restapi.bundle b/xCAT-test/autotest/bundle/restapi.bundle index ebd58aa63..093ff7801 100644 --- a/xCAT-test/autotest/bundle/restapi.bundle +++ b/xCAT-test/autotest/bundle/restapi.bundle @@ -24,4 +24,5 @@ restapi_list_invalid_resource restapi_list_wrong_osimage restapi_modify_wrong_field_CN restapi_delete_temp_CN_put +restapi_nodeshell_cmd_root restapi_cleanup_on_MN_CN diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index be4f23080..c536001ca 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -237,3 +237,11 @@ cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVA check:rc==0 check:output=~'vmmemori' is not a valid attribute name for an object type end + +start:restapi_nodeshell_cmd_root +description: Call nodeshell method to execute a command by root user +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X POST -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/$$CN/nodeshell?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"command\":\"id\"}'" +check:rc==0 +check:output=~root +end