Fix E2E pipeline and increment the version (#17)

* Add parameters to script call

* fix e2e yml and some output

* fix source paths

* fix source paths

* line endings to Unix

* add unit test output + remove setup step for unit test pipeline

* Test local files

* Add copyrights

* Remove empty unit test files from yml

* Fix psot install validation bug

* Fix e2e cd location

* Quote angle brackets

* Allow for changes to propagate

* Set test result correctly on success

* Publish logs as artifacts

* Address PR feedback

* Remove log publishing

* Fix unit test source

* Fix unit test source

* Ubuntu 20.04 is not supported by this script
This commit is contained in:
Mariana Mihova 2021-05-18 20:55:37 -07:00 коммит произвёл GitHub
Родитель 769d4903cf
Коммит 033bb4d6b4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
20 изменённых файлов: 250 добавлений и 205 удалений

Просмотреть файл

@ -63,7 +63,7 @@ function download_bash_script() {
}
# script
printf "Running azure-iot-edge-installer.sh\n" > /dev/stdout
printf "Welcome to azure-iot-edge-installer\n" > /dev/stdout
# if helper scripts dont exist, fetch via wget
if [ -d "iot-edge-installer" ];
@ -102,7 +102,7 @@ if [[ ${#@} > 0 && ${#parsed_cmds[*]} == 0 ]];
then
array=("$*")
echo Unknown argument "${array[*]}"
echo Usage
echo "Usage: sudo ./azure-iot-edge-installer.sh -s <IDScope> -r <RegistrationID> -k <Symmetric Key>"
exit 1
fi
@ -111,7 +111,7 @@ then
echo Missing argument
echo defined: "'"${!parsed_cmds[@]}"'"
echo given: "'"${parsed_cmds[@]}"'"
echo Usage
echo "Usage: sudo ./azure-iot-edge-installer.sh -s <IDScope> -r <RegistrationID> -k <Symmetric Key>"
exit 1
fi

Просмотреть файл

@ -44,9 +44,9 @@ function validate_post_install() {
"aziot-certd"
"aziot-tpmd")
for i in "${iotedge_services[@]}"
for service_name in "${iotedge_services[@]}"
do
is_service_running ${iotedge_services[$i]} "$status"
is_service_running $service_name "$status"
done
log_info "Post install validation completed."

Просмотреть файл

@ -1,4 +1,8 @@
#!/usr/bin/env bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
######################################
# test-devicestate
#
@ -127,10 +131,14 @@ scope_id=$(jq -r '.idScope' <<< "$creds")
primary_key=$(jq -r '.symmetricKey.primaryKey' <<< "$creds")
echo Run the Azure IoT Edge Installer
wget https://github.com/Azure/iot-edge-config/releases/latest/download/azure-iot-edge-installer.sh \
&& chmod +x azure-iot-edge-installer.sh \
&& ./azure-iot-edge-installer.sh \
&& rm -rf azure-iot-edge-installer.sh
#wget -O azure-iot-edge-installer.sh https://github.com/Azure/iot-edge-config/releases/latest/download/azure-iot-edge-installer.sh \
cd ./../../src
chmod +x azure-iot-edge-installer.sh
sudo LOCAL_E2E=1 ./azure-iot-edge-installer.sh --scope-id "$scope_id" --registration-id "$device_id" --symmetric-key "$primary_key"
rm -rf azure-iot-edge-installer.sh
# give 2 mins for changes to propagate to central app
sleep 120
# device state should be provisioned after running the script
out=$(curl -X GET -H "Authorization:$apiToken" https://${centralapp_name}.azureiotcentral.com/api/preview/devices/${device_id})
@ -143,10 +151,10 @@ then
echo "Error: Device must be provisioned. Exit.";
else
echo "Device is provisioned as expected. Success.";
$test_result=0 # success
test_result=0 # success
fi;
# Clean up
cleanup "$armToken" "$apiToken" "$device_id" "$token_id" "$rg" "$centralapp_name"
echo test_result: $test_result
exit $test_result

Просмотреть файл

@ -1,5 +1,8 @@
#!/usr/bin/env bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
######################################
# perf_tests
#

Просмотреть файл

@ -1,5 +1,8 @@
#!/usr/bin/env python3
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import argparse
import sys

Просмотреть файл

@ -1,5 +1,8 @@
#!/usr/bin/env bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
if command -v tput &>/dev/null && tty -s; then
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)

Просмотреть файл

@ -1,5 +1,8 @@
#!/usr/bin/env bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
######################################
# track_duration
#

Просмотреть файл

@ -1,5 +1,8 @@
#!/usr/bin/env bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# import utils.sh
source ../../src/utils.sh

Просмотреть файл

@ -1,2 +0,0 @@
#script
echo "Running test-install-container-management.sh"

Просмотреть файл

@ -1,2 +0,0 @@
#script to install edge runtime 1.2
echo "Running test-install-edge-runtime.sh"

Просмотреть файл

@ -1,5 +1,8 @@
#!/usr/bin/env bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
exec 3>&1
# bring in the utils library

Просмотреть файл

@ -1,7 +1,11 @@
#!/usr/bin/env bash
source src/validate-post-install.sh
source tests/test_utils.sh
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
source ../../src/utils.sh
source ../../src/validate-post-install.sh
source ../test_utils.sh
test_service_running() {
is_service_running "servicenameA" "servicenameA Running"
@ -28,6 +32,11 @@ test_service_casesensitive() {
assert_eq 0 $?
}
test_service_casesensitive() {
is_service_running "servicenameA" "servicenameA ruNNing"
assert_eq 0 $?
}
# run tests
test_service_running
test_service_ready

Просмотреть файл

@ -1,7 +1,11 @@
#!/usr/bin/env bash
source src/validate-tier1-os.sh
source tests/test_utils.sh
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
source ../../src/utils.sh
source ../../src/validate-tier1-os.sh
source ../test_utils.sh
test_ubuntu1804() {
ID="ubuntu"

Просмотреть файл

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
@ -38,7 +41,7 @@ stages:
- job: RaspberryPiE2ETests
pool:
vmImage: ubuntu-latest
vmImage: ubuntu-18.04
steps:
- template: continuous-e2e.yml
dependsOn: SetupScript

Просмотреть файл

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:

Просмотреть файл

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
@ -10,11 +13,6 @@ stages:
- stage: UnitTest
displayName: Unit Tests
jobs:
- job: SetupScript
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- job: LinuxUnitTests
pool:
vmImage: ubuntu-18.04

Просмотреть файл

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
steps:
- task: AzureCLI@2
inputs:
@ -9,4 +12,3 @@ steps:
chmod +x test-devicestate.sh
./test-devicestate.sh $(AzureSubscriptionId)
displayName: 'Run All E2E Tests'

Просмотреть файл

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
steps:
- task: UsePythonVersion@0
displayName: "Use Python 3.8"

Просмотреть файл

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
steps:
- script: echo Hello Linux!
displayName: 'Echo Hello Linux'
@ -5,8 +8,6 @@ steps:
- script: |
cd tests/unit-tests
chmod +x ./*.sh
./test-install-container-management.sh
./test-install-edge-runtime.sh
./test-validate-post-install.sh
./test-validate-tier1-os.sh
./test-cmd-parser.sh

Просмотреть файл

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
steps:
- script: echo Hello Raspi!
displayName: 'Echo Hello Raspi!'
@ -5,11 +8,8 @@ steps:
- script: |
cd tests/unit-tests
chmod +x ./*.sh
./test-install-container-management.sh
./test-install-edge-runtime.sh
./test-validate-post-install.sh
./test-validate-tier1-os.sh
./test-cmd-parser.sh
./test-logger.sh
displayName: 'Run All Raspberry Pi Unit Tests'