OOF HAS CSIT with MUSIC v3 integration

Updated HAS setup and teardown scripts
Added MUSIC v3 support, AAF support, Basic Authorization for MUSIC.
Used AAF_RootCA for A&AI simulator.
Sync conductor.conf based on generated latest conf.

Change-Id: Id1a6c8a4e524a6ade5b60277a6cb538724902d11
Issue-ID: OPTFRA-366
Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
diff --git a/tests/optf-has/has/optf_has_test.robot b/tests/optf-has/has/optf_has_test.robot
index 3b3ee7a..8bd313a 100644
--- a/tests/optf-has/has/optf_has_test.robot
+++ b/tests/optf-has/has/optf_has_test.robot
@@ -5,6 +5,11 @@
 
 *** Variables ***
 ${MESSAGE}    {"ping": "ok"}
+${BASIC}    Basic
+${Music_AUTHVALUE}    Y29uZHVjdG9yOmMwbmR1Y3Qwcg==
+${HAS_AUTHVALUE}    YWRtaW4xOnBsYW4uMTU=
+${Music_Auth}    ${BASIC} ${Music_AUTHVALUE}
+${HAS_Auth}    ${BASIC} ${HAS_AUTHVALUE}
 ${RESP_STATUS}     "error"
 ${RESP_MESSAGE_WRONG_VERSION}    "conductor_template_version must be one of: 2016-11-01"
 ${RESP_MESSAGE_WITHOUT_DEMANDS}    Undefined Demand
@@ -54,7 +59,7 @@
 Get Music Version
     [Documentation]    It sends a REST GET request to retrieve the Music.war version
     Create Session   musicaas            ${MUSIC_HOSTNAME}:${MUSIC_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        musicaas   /MUSIC/rest/v2/version     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -109,7 +114,7 @@
 Get Root Url
     [Documentation]    It sends a REST GET request to root url
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -121,7 +126,7 @@
     [Documentation]    It sends a REST PUT request to Music to inject healthcheck plan
     Create Session   musicaas            ${MUSIC_HOSTNAME}:${MUSIC_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}healthcheck.json
-    &{headers}=      Create Dictionary    ns=conductor    userId=conductor    password=c0nduct0r   Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    ns=conductor    Authorization=${Music_Auth}    userId=conductor    password=c0nduct0r   Content-Type=application/json  Accept=application/json
     ${resp}=         Put Request        musicaas   /MUSIC/rest/v2/keyspaces/conductor/tables/plans/rows?id=healthcheck    data=${data}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -133,7 +138,7 @@
 Healthcheck
     [Documentation]    It sends a REST GET request to healthcheck url
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/healthcheck     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -144,7 +149,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_wrong_version.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -159,7 +164,7 @@
 GetPlanWithWrongVersion
     [Documentation]    It sends a REST GET request to capture error
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -175,7 +180,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_without_demand_section.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -190,7 +195,7 @@
 GetPlanWithoutDemandSection
     [Documentation]    It sends a REST GET request to capture error
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -206,7 +211,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_wrong_distance_constraint.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -221,7 +226,7 @@
 GetPlanWithWrongConstraint
     [Documentation]    It sends a REST GET request to capture error
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -238,7 +243,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_lati_and_longi.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -253,7 +258,7 @@
 GetPlanWithLatiAndLongi
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -269,7 +274,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_short_distance_constraint.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -284,7 +289,7 @@
 GetPlanWithShortDistanceConstraint
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -300,7 +305,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_vim_fit.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -315,7 +320,7 @@
 GetPlanWithVimFit
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -331,7 +336,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_hpa.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -346,7 +351,7 @@
 GetPlanWithHpa
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -362,7 +367,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_hpa_simple.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -377,7 +382,7 @@
 GetPlanWithHpaSimple
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -393,7 +398,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_hpa_requirements_mandatory.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -408,7 +413,7 @@
 GetPlanWithHpaMandatory
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -424,7 +429,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_hpa_requirements_optionals.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -439,7 +444,7 @@
 GetPlanWithHpaOptionals
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -455,7 +460,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_hpa_unmatched.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -470,7 +475,7 @@
 GetPlanWithHpaUnmatched
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -487,7 +492,7 @@
     [Documentation]    It sends a POST request to conductor
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
     ${data}=         Get Binary File     ${CURDIR}${/}data${/}plan_with_hpa_score_multi_objective.json
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Post Request        optf-cond   /v1/plans     data=${data}     headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}
@@ -502,7 +507,7 @@
 GetPlanWithHpaScoreMultiObj
     [Documentation]    It sends a REST GET request to capture recommendations
     Create Session   optf-cond            ${COND_HOSTNAME}:${COND_PORT}
-    &{headers}=      Create Dictionary    Content-Type=application/json  Accept=application/json
+    &{headers}=      Create Dictionary    Authorization=${HAS_Auth}    Content-Type=application/json  Accept=application/json
     ${resp}=         Get Request        optf-cond   /v1/plans/${generatedPlanId}    headers=${headers}
     Log To Console              *********************
     Log To Console              response = ${resp}