Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Cherry-pick Mariner Test to release/1.3 #6566

Draft
wants to merge 1 commit into
base: release/1.3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion builds/e2e/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,58 @@ jobs:
- template: templates/e2e-clear-docker-cached-images.yaml
- template: templates/e2e-run.yaml
parameters:
test_type: http_proxy
test_type: http_proxy

################################################################################
- job: mariner1_amd64
################################################################################
displayName: Mariner 1.0 amd64
condition: eq(variables['run.EFLOW.amd64'], 'true')
pool:
name: $(pool.custom.name)
demands:
- Agent.OS -equals Linux
- Agent.OSArchitecture -equals X64
- run-new-e2e-tests -equals true
- mariner -equals true
- mariner-version -equals 1.0

variables:
os: linux
arch: amd64
artifactName: iotedged-mariner1-amd64
identityServiceArtifactName: packages_mariner-1_amd64
identityServicePackageFilter: aziot-identity-service-*.cm1.x86_64.rpm

steps:
- template: templates/e2e-clean-directory.yaml
- template: templates/e2e-setup.yaml
- template: templates/e2e-clear-docker-cached-images.yaml
- template: templates/e2e-run.yaml

################################################################################
- job: mariner2_amd64
################################################################################
displayName: Mariner 2.0 amd64
condition: eq(variables['run.EFLOW.amd64'], 'true')
pool:
name: $(pool.custom.name)
demands:
- Agent.OS -equals Linux
- Agent.OSArchitecture -equals X64
- run-new-e2e-tests -equals true
- mariner -equals true
- mariner-version -equals 2.0

variables:
os: linux
arch: amd64
artifactName: iotedged-mariner2-amd64
identityServiceArtifactName: packages_mariner-2_amd64
identityServicePackageFilter: aziot-identity-service-*.cm2.x86_64.rpm

steps:
- template: templates/e2e-clean-directory.yaml
- template: templates/e2e-setup.yaml
- template: templates/e2e-clear-docker-cached-images.yaml
- template: templates/e2e-run.yaml
136 changes: 136 additions & 0 deletions builds/e2e/longhaul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,139 @@ jobs:
test.deploymentFileName: 'long_haul_deployment_constrained.template.json'
testResultCoordinator.storageAccountConnectionString: '$(EdgeLonghaulStorageAccountConnString)'
clientModuleTransportType: 'mqtt'

################################################################################
- job: Mariner1_amd64
################################################################################
displayName: Mariner 1.0 AMD64
condition: and(eq(variables['run.EFLOW.amd64'], 'true'), eq(variables['useTRC'], 'true'))
pool:
name: $(pool.name)
demands:
- Agent.OS -equals Linux
- Agent.OSArchitecture -equals X64
- mariner -equals true
- mariner-version -equals 1.0
- run-long-haul-eflow -equals true
steps:
- template: templates/longhaul-setup.yaml
parameters:
edgelet.artifact.name: 'iotedged-mariner1-amd64'
images.artifact.name: '$(images.artifact.name.linux)'
aziotis.artifact.name: 'packages_mariner-1_amd64'
aziotis.package.filter: 'aziot-identity-service-*.x86_64.rpm'
identityServiceArtifactName: packages_mariner-1_amd64
quickstart.artifactName: 'IotEdgeQuickstart.linux-x64.tar.gz'
- task: DeleteFiles@1
inputs:
SourceFolder: '$(Agent.HomeDirectory)/../artifacts/'
contents: |
aziot-identity-service-devel-*.x86_64.rpm
- template: templates/longhaul-deploy.yaml
parameters:
release.label: 'lh$(agent.group)'
test.buildNumber: '$(Build.BuildNumber)'
test.buildId: '$(Build.BuildId)'
test.startDelay: '$(test.startDelay.amd)'
build.source.branch: '$(Build.SourceBranchName)'
build.repo.path: '$(Build.SourcesDirectory)'
edgelet.source.branch: '$(edgelet.package.branchName)'
images.source.branch: '$(images.branchName)'
edgelet.artifact.name: '$(edgelet.artifact.name)'
images.artifact.name: '$(images.artifact.name.linux)'
container.registry: '$(container.registry)'
container.registry.username: '$(edgebuilds-azurecr-io-username)'
container.registry.password: '$(edgebuilds-azurecr-io-pwd)'
iotHub.connectionString: '$(IotHub-ConnStr)'
eventHub.connectionString: '$(IotHub-EventHubConnStr)'
snitch.build.number: '$(snitch.build.number)'
snitch.alert.url: '$(SnitchLongHaulAlertUrl)'
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
longHaul.desiredModulesToRestartCSV: '$(longHaul.desiredModulesToRestartCSV)'
longHaul.restartIntervalInMins: '$(longHaul.restartIntervalInMins)'
longHaul.sendReportFrequency: '$(longHaul.sendReportFrequency)'
test.runtimeLogLevel: '$(test.runtimeLogLevel)'
analyzer.consumerGroupId: 'longhaul_mariner1_amd64'
logAnalytics.workspaceId: '$(kvLogAnalyticWorkspaceId)'
logAnalytics.sharedKey: '$(kvLogAnalyticSharedKey)'
logAnalytics.logType: '$(logAnalyticsLogType)'
twinTester.twinUpdateSize: '$(twinTester.twinUpdateSize)'
metricsCollector.metricsEndpointsCSV: '$(metricsCollector.metricsEndpointsCSV)'
metricsCollector.scrapeFrequencyInSecs: '$(metricsCollector.scrapeFrequencyInSecs)'
metricsCollector.uploadTarget: '$(metricsCollector.uploadTarget)'
metricsCollector.hostPlatform: 'mariner1_amd64'
test.testMode: 'LongHaul'
test.useTRC: '$(useTRC)'
test.deploymentFileName: 'long_haul_deployment.template.json'
testResultCoordinator.storageAccountConnectionString: '$(EdgeLonghaulStorageAccountConnString)'
clientModuleTransportType: 'All'
packageType: 'rpm'

################################################################################
- job: Mariner2_amd64
################################################################################
displayName: Mariner 2.0 AMD64
condition: and(eq(variables['run.EFLOW.amd64'], 'true'), eq(variables['useTRC'], 'true'))
pool:
name: $(pool.name)
demands:
- Agent.OS -equals Linux
- Agent.OSArchitecture -equals X64
- mariner -equals true
- mariner-version -equals 2.0
- run-long-haul-eflow -equals true
steps:
- template: templates/longhaul-setup.yaml
parameters:
edgelet.artifact.name: 'iotedged-mariner2-amd64'
images.artifact.name: '$(images.artifact.name.linux)'
aziotis.artifact.name: 'packages_mariner-2_amd64'
aziotis.package.filter: 'aziot-identity-service-*.x86_64.rpm'
identityServiceArtifactName: packages_mariner-2_amd64
quickstart.artifactName: 'IotEdgeQuickstart.linux-x64.tar.gz'
- task: DeleteFiles@1
inputs:
SourceFolder: '$(Agent.HomeDirectory)/../artifacts/'
contents: |
aziot-identity-service-devel-*.x86_64.rpm
- template: templates/longhaul-deploy.yaml
parameters:
release.label: 'lh$(agent.group)'
test.buildNumber: '$(Build.BuildNumber)'
test.buildId: '$(Build.BuildId)'
test.startDelay: '$(test.startDelay.amd)'
build.source.branch: '$(Build.SourceBranchName)'
build.repo.path: '$(Build.SourcesDirectory)'
edgelet.source.branch: '$(edgelet.package.branchName)'
images.source.branch: '$(images.branchName)'
edgelet.artifact.name: '$(edgelet.artifact.name)'
images.artifact.name: '$(images.artifact.name.linux)'
container.registry: '$(container.registry)'
container.registry.username: '$(edgebuilds-azurecr-io-username)'
container.registry.password: '$(edgebuilds-azurecr-io-pwd)'
iotHub.connectionString: '$(IotHub-ConnStr)'
eventHub.connectionString: '$(IotHub-EventHubConnStr)'
snitch.build.number: '$(snitch.build.number)'
snitch.alert.url: '$(SnitchLongHaulAlertUrl)'
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
longHaul.desiredModulesToRestartCSV: '$(longHaul.desiredModulesToRestartCSV)'
longHaul.restartIntervalInMins: '$(longHaul.restartIntervalInMins)'
longHaul.sendReportFrequency: '$(longHaul.sendReportFrequency)'
test.runtimeLogLevel: '$(test.runtimeLogLevel)'
analyzer.consumerGroupId: 'longhaul_mariner1_amd64'
logAnalytics.workspaceId: '$(kvLogAnalyticWorkspaceId)'
logAnalytics.sharedKey: '$(kvLogAnalyticSharedKey)'
logAnalytics.logType: '$(logAnalyticsLogType)'
twinTester.twinUpdateSize: '$(twinTester.twinUpdateSize)'
metricsCollector.metricsEndpointsCSV: '$(metricsCollector.metricsEndpointsCSV)'
metricsCollector.scrapeFrequencyInSecs: '$(metricsCollector.scrapeFrequencyInSecs)'
metricsCollector.uploadTarget: '$(metricsCollector.uploadTarget)'
metricsCollector.hostPlatform: 'mariner2_amd64'
test.testMode: 'LongHaul'
test.useTRC: '$(useTRC)'
test.deploymentFileName: 'long_haul_deployment.template.json'
testResultCoordinator.storageAccountConnectionString: '$(EdgeLonghaulStorageAccountConnString)'
clientModuleTransportType: 'All'
packageType: 'rpm'
2 changes: 2 additions & 0 deletions builds/e2e/templates/longhaul-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ parameters:
test.deploymentFileName: ''
testResultCoordinator.storageAccountConnectionString: ''
clientModuleTransportType: ''
packageType: 'deb'

steps:
- task: Bash@3
Expand Down Expand Up @@ -100,6 +101,7 @@ steps:
-testName "$testName" \
-repoPath "${{ parameters['build.repo.path'] }}" \
-clientModuleTransportType "${{ parameters['clientModuleTransportType'] }}" \
-packageType "${{ parameters['packageType'] }}" \
-waitForTestComplete \
-cleanAll
else
Expand Down
2 changes: 1 addition & 1 deletion builds/e2e/templates/longhaul-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ steps:
displayName: 'Copy aziot-identity-service'
inputs:
SourceFolder: "$(Build.StagingDirectory)"
Contents: "aziot-identity-service*.deb"
Contents: "${{ parameters['aziotis.package.filter'] }}"
TargetFolder: "$(Agent.HomeDirectory)/../artifacts/"
19 changes: 16 additions & 3 deletions scripts/linux/trcE2ETest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function usage() {
echo " -clientModuleTransportType Value for contrained long haul specifying transport type for all client modules."
echo " -trackingId Tracking id used to tag test events. Needed if running nested tests and test events are sent to TRC from L4 node. Otherwise generated."
echo ' -cleanAll Do docker prune for containers, logs and volumes.'
echo ' -packageType Package type to be used [deb, rpm]'
exit 1;
}

Expand Down Expand Up @@ -90,9 +91,9 @@ function get_artifact_file() {

local filter
case "$fileType" in
'aziot_edge' ) filter='aziot-edge_*.deb';;
'aziot_is' ) filter='aziot-identity-service_*.deb';;
'quickstart' ) filter='core-linux/IotEdgeQuickstart.linux*.tar.gz';;
'aziot_edge' ) filter="aziot-edge*.$PACKAGE_TYPE";;
'aziot_is' ) filter="aziot-identity-service*.$PACKAGE_TYPE";;
'quickstart' ) filter="core-linux/IotEdgeQuickstart.linux*.tar.gz";;
*) print_error "Unknown file type: $fileType"; exit 1;;
esac

Expand Down Expand Up @@ -461,6 +462,9 @@ function process_args() {
elif [ $saveNextArg -eq 48 ]; then
TOPOLOGY="$arg"
saveNextArg=0;
elif [ $saveNextArg -eq 49 ]; then
PACKAGE_TYPE="$arg"
saveNextArg=0
else
case "$arg" in
'-h' | '--help' ) usage;;
Expand Down Expand Up @@ -512,6 +516,7 @@ function process_args() {
'-clientModuleTransportType' ) saveNextArg=46;;
'-trackingId' ) saveNextArg=47;;
'-topology' ) saveNextArg=48;;
'-packageType' ) saveNextArg=49;;
'-waitForTestComplete' ) WAIT_FOR_TEST_COMPLETE=1;;
'-cleanAll' ) CLEAN_ALL=1;;

Expand Down Expand Up @@ -810,6 +815,7 @@ function run_longhaul_test() {
--device_ca_cert "$DEVICE_CA_CERT" \
--device_ca_pk "$DEVICE_CA_PRIVATE_KEY" \
--trusted_ca_certs "$TRUSTED_CA_CERTS" \
$PACKAGE_TYPE_ARG \
$BYPASS_EDGE_INSTALLATION \
--no-verify && ret=$? || ret=$?
fi
Expand Down Expand Up @@ -905,6 +911,13 @@ NETWORK_CONTROLLER_FREQUENCIES=${NETWORK_CONTROLLER_FREQUENCIES:(null)}
working_folder="$E2E_TEST_DIR/working"
quickstart_working_folder="$working_folder/quickstart"

if [ -z $PACKAGE_TYPE ]; then
echo 'Package type not specifed default to .deb'
PACKAGE_TYPE=deb
fi

PACKAGE_TYPE_ARG=--package-type="$PACKAGE_TYPE"

if [ "$image_architecture_label" = 'amd64' ]; then
optimize_for_performance=true
log_upload_enabled=true
Expand Down
23 changes: 21 additions & 2 deletions smoke/IotEdgeQuickstart/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ class Program
[Option("--parent-edge-device", Description = "Optional input to specify parent edge device id for nested edge scenario")]
public string ParentEdgeDevice { get; } = string.Empty;

[Option("--package-type", Description = "specifes the type of package files that will be used")]
public string PackageType { get; } = string.Empty;

[Option("--overwrite-packages", Description = "Overwrite existing aziot packages with those specified in the bootstrapper")]
public bool OverwritePackages { get; } = false;

Expand Down Expand Up @@ -233,8 +236,24 @@ async Task<int> OnExecuteAsync()
: Option.None<HttpUris>();

UriSocks socks = new UriSocks(this.ConnectManagementUri, this.ConnectWorkloadUri, this.ListenManagementUri, this.ListenWorkloadUri);

bootstrapper = new IotedgedLinux(this.BootstrapperArchivePath, credentials, uris, socks, proxy, upstreamProtocolOption, !this.BypassEdgeInstallation, this.OverwritePackages);
ILinuxPackageInstall installMethod;
if (!this.BypassEdgeInstallation)
{
if (!string.IsNullOrEmpty(this.PackageType) && this.PackageType.ToLower().Equals("rpm"))
{
installMethod = new LinuxPackageInstallRPM(this.BootstrapperArchivePath);
}
else
{
installMethod = new LinuxPackageInstallDep(this.BootstrapperArchivePath);
}
}
else
{
installMethod = new LinuxPackageNonInstall();
}

bootstrapper = new IotedgedLinux(credentials, uris, socks, proxy, upstreamProtocolOption, this.OverwritePackages, installMethod);
}

break;
Expand Down
Loading