Skip to content

Commit

Permalink
migrate gg discovery test
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Nov 21, 2024
1 parent 2211542 commit cc8b4aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
7 changes: 4 additions & 3 deletions test-integration/IntegrationTests/IntegrationTestDiscovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
TIME_OUT_SEC = 30
# This is a pre-generated test data from DRS integration tests
ID_PREFIX = "Id-"
GGC_ARN = "arn:aws:iot:us-east-1:180635532705:thing/CI_Greengrass_Discovery_Thing"
GGC_ARN = "arn:aws:iot:us-east-1:003261610643:thing/DRS_GGC_0kegiNGA_0"
GGC_PORT_NUMBER_BASE = 8080
GGC_HOST_ADDRESS_PREFIX = "192.168.101."
METADATA_PREFIX = "Description-"
GROUP_ID = "627bf63d-ae64-4f58-a18c-80a44fcf4088"
THING_NAME = "CI_Greengrass_Discovery_Thing"
THING_NAME = "DRS_GGAD_0kegiNGA_0"
EXPECTED_CA_CONTENT = "-----BEGIN CERTIFICATE-----\n" \
"MIIEFTCCAv2gAwIBAgIVAPZfc4GMLZPmXbnoaZm6jRDqDs4+MA0GCSqGSIb3DQEB\n" \
"CwUAMIGoMQswCQYDVQQGEwJVUzEYMBYGA1UECgwPQW1hem9uLmNvbSBJbmMuMRww\n" \
Expand Down Expand Up @@ -155,8 +155,9 @@ def _verify_ca_list(ca_list):


def verify_all_cores(discovery_info):
print("Verifying \"getAllCores\"...")
ggc_info_list = discovery_info.getAllCores()
print("Verifying \"getAllCores\"... {0}".format(len(ggc_info_list)))
assert len(ggc_info_list) == 1
_verify_ggc_info(ggc_info_list[0])
print("Pass!")

Expand Down
29 changes: 9 additions & 20 deletions test-integration/run/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,14 @@
# Define const
USAGE="usage: run.sh <testMode> <NumberOfMQTTMessages> <LengthOfShadowRandomString> <NumberOfNetworkFailure>"

AWSHost="arn:aws:secretsmanager:us-east-1:180635532705:secret:unit-test/endpoint-HSpeEu"
UnitTestHostArn="arn:aws:secretsmanager:us-east-1:180635532705:secret:unit-test/endpoint-HSpeEu"
GreenGrassHostArn="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/greengrassv1/endpoint-DgM00X"

AWSMutualAuth_TodWorker_private_key="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/mqtt5/us/Mqtt5Prod/key-kqgyvf"
AWSMutualAuth_TodWorker_certificate="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/mqtt5/us/Mqtt5Prod/cert-VDI1Gd"

# AWSGGDiscovery_TodWorker_private_key="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/greengrassv1/key-QEWWRI"
# AWSGGDiscovery_TodWorker_certificate="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/greengrassv1/cert-2GJc26"

# AWSGGDiscovery_TodWorker_private_key="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/GreengrassDiscovery/key-Ki81FY"
# AWSGGDiscovery_TodWorker_certificate="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/GreengrassDiscovery/cert-bxUN3i"

AWSGGDiscovery_TodWorker_private_key="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/Greengrass/key-tHGj1k"
AWSGGDiscovery_TodWorker_certificate="arn:aws:secretsmanager:us-east-1:180635532705:secret:ci/Greengrass/cert-6RYeYf"


# AWSSecretForWebsocket_TodWorker_KeyId="arn:aws:secretsmanager:us-east-1:123124136734:secret:V1IotSdkIntegrationTestWebsocketAccessKeyId-1YdB9z"
# AWSSecretForWebsocket_TodWorker_SecretKey="arn:aws:secretsmanager:us-east-1:123124136734:secret:V1IotSdkIntegrationTestWebsocketSecretAccessKey-MKTSaV"
AWSGGDiscovery_TodWorker_private_key="arn:aws:secretsmanager:us-east-1:180635532705:secret:V1IotSdkIntegrationTestGGDiscoveryPrivateKey-BsLvNP"
AWSGGDiscovery_TodWorker_certificate="arn:aws:secretsmanager:us-east-1:180635532705:secret:V1IotSdkIntegrationTestGGDiscoveryCertificate-DSwdhA"


SDKLocation="./AWSIoTPythonSDK"
Expand All @@ -58,8 +49,8 @@ CREDENTIAL_DIR="./test-integration/Credentials/"
TEST_DIR="./test-integration/IntegrationTests/"
CA_CERT_URL="https://www.amazontrust.com/repository/AmazonRootCA1.pem"
CA_CERT_PATH=${CREDENTIAL_DIR}rootCA.crt
TestHost=$(python3 ${RetrieveAWSKeys} ${AWSHost})
echo ${TestHost}
TestHost=$(python ${RetrieveAWSKeys} ${UnitTestHostArn})
GreengrassHost=$(python ${RetrieveAWSKeys} ${GreenGrassHostArn})



Expand Down Expand Up @@ -122,14 +113,11 @@ else
echo "***************************************************"
for file in `ls ${TEST_DIR}`
do
# SKIP discovery for now
if [ ${file}x != "IntegrationTestDiscovery.py"x ]; then
continue;
fi
if [ ${file##*.}x == "py"x ]; then
echo "[SUB] Running test: ${file}..."

Scale=10
Host=TestHost
case "$file" in
"IntegrationTestMQTTConnection.py") Scale=$2
;;
Expand All @@ -141,7 +129,8 @@ else
;;
"IntegrationTestConfigurablePublishMessageQueueing.py") Scale=""
;;
"IntegrationTestDiscovery.py") Scale=""
"IntegrationTestDiscovery.py") Scale=""
Host=${GreengrassHost}
;;
"IntegrationTestAsyncAPIGeneralNotificationCallbacks.py") Scale=""
;;
Expand Down

0 comments on commit cc8b4aa

Please sign in to comment.