fixing api test xtargets bug

Change-Id: Iaf0b808ac8b8e9553078646c00832dc5ccbc7b0b
diff --git a/src/test/cord-api/Tests/targets/xosapitests.xtarget b/src/test/cord-api/Tests/targets/xosapitests.xtarget
index d256dd5..1cee21f 100644
--- a/src/test/cord-api/Tests/targets/xosapitests.xtarget
+++ b/src/test/cord-api/Tests/targets/xosapitests.xtarget
@@ -19,25 +19,15 @@
 *** Test Cases ***    TYPE        API
 {%- for m in proto.messages -%}
 {%- if m.name not in  ['XOSBase'] -%}
-{%- if m.name not in ['ServiceMonitoringAgentInfo', 'XOS'] -%}
 {% autoescape false %}
 {% endautoescape %}
-Create {{ m.name }}    CREATE    /xosapi/v1/${xos_service}/{{ m.name | lower}}s    ${json_{{ m.name | lower}}_1}
+Create {{ m.name }}    CREATE    /xosapi/v1/${xos_service}/{{ xproto_pluralize(m) | lower}}    ${json_{{ m.name | lower}}_1}
 
-Update {{ m.name }}    UPDATE    /xosapi/v1/${xos_service}/{{ m.name | lower}}s    ${json_{{ m.name | lower}}_updated_1}    ${id}
+Update {{ m.name }}    UPDATE    /xosapi/v1/${xos_service}/{{ xproto_pluralize(m) | lower}}    ${json_{{ m.name | lower}}_updated_1}    ${id}
 
-Get {{ m.name }}    RETRIEVE    /xosapi/v1/${xos_service}/{{ m.name | lower}}s    ${json_{{ m.name | lower}}_updated_1}    ${id}    ${json_{{ m.name | lower}}_updated_key}
+Get {{ m.name }}    RETRIEVE    /xosapi/v1/${xos_service}/{{ xproto_pluralize(m) | lower}}    ${json_{{ m.name | lower}}_updated_1}    ${id}    ${json_{{ m.name | lower}}_updated_key}
 
-Delete {{ m.name }}    DELETE    /xosapi/v1/${xos_service}/{{ m.name | lower}}s    data_id=${id}
-{% else %}
-Create {{ m.name }}    CREATE    /xosapi/v1/${xos_service}/{{ m.name | lower}}es    ${json_{{ m.name | lower}}_1}
-
-Update {{ m.name }}    UPDATE    /xosapi/v1/${xos_service}/{{ m.name | lower}}es    ${json_{{ m.name | lower}}_updated_1}    ${id}
-
-Get {{ m.name }}    RETRIEVE    /xosapi/v1/${xos_service}/{{ m.name | lower}}es    ${json_{{ m.name | lower}}_updated_1}    ${id}    ${json_{{ m.name | lower}}_updated_key}
-
-Delete {{ m.name }}    DELETE    /xosapi/v1/${xos_service}/{{ m.name | lower}}es    data_id=${id}
-{% endif %}
+Delete {{ m.name }}    DELETE    /xosapi/v1/${xos_service}/{{ xproto_pluralize(m) | lower}}    data_id=${id}
 {% endif %}
 {% endfor -%}
 
diff --git a/src/test/cord-api/Tests/targets/xoslibrary.xtarget b/src/test/cord-api/Tests/targets/xoslibrary.xtarget
index fb98677..8a7ccf8 100644
--- a/src/test/cord-api/Tests/targets/xoslibrary.xtarget
+++ b/src/test/cord-api/Tests/targets/xoslibrary.xtarget
@@ -162,7 +162,7 @@
     {% endfor -%}
     @{dependent_models}=    Create List
     Set Suite Variable    ${dependent_models}
-    ${auth} =    Create List    ${XOS_USER}    ${XOS_PASSWD}
+    ${auth} =    Create List    ${USER}    ${PASSWD}
     ${HEADERS}    Create Dictionary    Content-Type=application/json
     Create Session    ${SERVER_IP}    http://${SERVER_IP}:${SERVER_PORT}    auth=${AUTH}    headers=${HEADERS}
     Generate JSON Data
diff --git a/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget b/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
index 551f179..a4db860 100644
--- a/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
+++ b/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
@@ -22,33 +22,19 @@
 {% for m in proto.messages %}
 {%- if xproto_unquote(m.options.app_label) != "core" -%}
 {%- if m.name not in  ['XOSBase'] -%}
-{%- if m.name not in ['ServiceMonitoringAgentInfo', 'XOS'] -%}
 {% autoescape false %}
 {% endautoescape %}
-Create {{ m.name }}    CREATE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s    ${json_{{ m.name | lower}}_1}
+Create {{ m.name }}    CREATE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower}}    ${json_{{ m.name | lower}}_1}
     [Tags]    {{ m.name }}
 
-Update {{ m.name }}    UPDATE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s    ${json_{{ m.name | lower}}_updated_1}    ${id}
+Update {{ m.name }}    UPDATE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower}}    ${json_{{ m.name | lower}}_updated_1}    ${id}
     [Tags]    {{ m.name }}
 
-Get {{ m.name }}    RETRIEVE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s    ${json_{{ m.name | lower}}_updated_1}    ${id}    ${json_{{ m.name | lower}}_updated_key}
+Get {{ m.name }}    RETRIEVE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower}}    ${json_{{ m.name | lower}}_updated_1}    ${id}    ${json_{{ m.name | lower}}_updated_key}
     [Tags]    {{ m.name }}
 
-Delete {{ m.name }}    DELETE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s    data_id=${id}
+Delete {{ m.name }}    DELETE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower}}    data_id=${id}
     [Tags]    {{ m.name }}
-{% else %}
-Create {{ m.name }}    CREATE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es    ${json_{{ m.name | lower}}_1}
-    [Tags]    {{ m.name }}
-
-Update {{ m.name }}    UPDATE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es    ${json_{{ m.name | lower}}_updated_1}    ${id}
-    [Tags]    {{ m.name }}
-
-Get {{ m.name }}    RETRIEVE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es    ${json_{{ m.name | lower}}_updated_1}    ${id}    ${json_{{ m.name | lower}}_updated_key}
-    [Tags]    {{ m.name }}
-
-Delete {{ m.name }}    DELETE    /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es    data_id=${id}
-    [Tags]    {{ m.name }}
-{% endif -%}
 {% endif -%}
 {% endif -%}
 {% endfor %}