Skip to content

Commit 0dc7e3b

Browse files
akoeplingerwfurt
andauthored
[release/6.0] Docker fixes for the enterprise linux testing pipeline (#68913)
* attempt to fix up EnterpriseTests (#65981) * attemp to fix up EnterpriseTests * fix text * increase timoeout on build step * fix temeout * add jobs * update job * fix formating * fix name * update server check * restore original resolver before tests * fix path * experiment (cherry picked from commit 9174037) * upgrade docker to get clang9 to prevent coreclr crashes (#68311) (cherry picked from commit edb9c49) * Use Docker images from mcr.microsoft.com in EnterpriseTests (#68875) We started getting warnings in the build about using images from docker directly, see https://docs.opensource.microsoft.com/tools/nuget_security_analysis/container_registry_analysis/ The image from dotnet-buildtools-prereqs-docker can be used instead. (cherry picked from commit bafae1b) Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com>
1 parent 86308dc commit 0dc7e3b

File tree

6 files changed

+54
-43
lines changed

6 files changed

+54
-43
lines changed

eng/pipelines/libraries/enterprise/linux.yml

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ pr:
1818
- src/libraries/System.Net.Http/*
1919
- src/libraries/System.Net.Security/*
2020

21-
pool:
22-
name: NetCore1ESPool-Svc-Public
23-
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
24-
2521
variables:
2622
- template: ../variables.yml
2723
- name: enterpriseTestsSetup
@@ -31,45 +27,54 @@ variables:
3127
- name: containerLibrariesRoot
3228
value: /repo/src/libraries
3329

34-
steps:
35-
- bash: |
36-
cd $(enterpriseTestsSetup)
37-
docker-compose build
38-
displayName: Build test machine images
39-
env:
40-
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
30+
jobs:
31+
- job: EnterpriseLinuxTests
32+
timeoutInMinutes: 120
33+
pool:
34+
name: NetCore1ESPool-Svc-Public
35+
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
36+
steps:
37+
- bash: |
38+
cd $(enterpriseTestsSetup)
39+
docker-compose build
40+
displayName: Build test machine images
41+
env:
42+
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
4143
42-
- bash: |
43-
cd $(enterpriseTestsSetup)
44-
docker-compose up -d
45-
displayName: Start test network and machines
46-
env:
47-
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
44+
- bash: |
45+
cd $(enterpriseTestsSetup)
46+
docker-compose up -d
47+
displayName: Start test network and machines
48+
env:
49+
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
4850
49-
- bash: |
50-
docker exec linuxclient bash /setup/test-webserver.sh
51-
displayName: Test linuxclient connection to web server
51+
- bash: |
52+
docker exec linuxclient bash /setup/test-webserver.sh
53+
displayName: Test linuxclient connection to web server
5254
53-
- bash: |
54-
docker exec linuxclient bash -c '/repo/build.sh -subset clr+libs -runtimeconfiguration release -ci /p:NoPgoOptimize=true'
55-
displayName: Build product sources
55+
- bash: |
56+
docker exec linuxclient bash -c '/repo/build.sh -subset clr+libs -runtimeconfiguration release -ci /p:NoPgoOptimize=true'
57+
docker exec linuxclient bash -c '/repo/dotnet.sh build $(containerLibrariesRoot)/System.Net.Http/tests/EnterpriseTests/System.Net.Http.Enterprise.Tests.csproj'
58+
docker exec linuxclient bash -c '/repo/dotnet.sh build $(containerLibrariesRoot)/System.Net.Security/tests/EnterpriseTests/System.Net.Security.Enterprise.Tests.csproj'
59+
displayName: Build product sources
5660
57-
- bash: |
58-
docker exec linuxclient $(containerRunTestsCommand) $(containerLibrariesRoot)/System.Net.Http/tests/EnterpriseTests/System.Net.Http.Enterprise.Tests.csproj
59-
docker exec linuxclient $(containerRunTestsCommand) $(containerLibrariesRoot)/System.Net.Security/tests/EnterpriseTests/System.Net.Security.Enterprise.Tests.csproj
60-
displayName: Build and run tests
61+
- bash: |
62+
docker exec linuxclient bash -c 'if [ -f /erc/resolv.conf.ORI ]; then cp -f /erc/resolv.conf.ORI /etc/resolv.conf; fi'
63+
docker exec linuxclient $(containerRunTestsCommand) $(containerLibrariesRoot)/System.Net.Http/tests/EnterpriseTests/System.Net.Http.Enterprise.Tests.csproj
64+
docker exec linuxclient $(containerRunTestsCommand) $(containerLibrariesRoot)/System.Net.Security/tests/EnterpriseTests/System.Net.Security.Enterprise.Tests.csproj
65+
displayName: Build and run tests
6166
62-
- bash: |
63-
cd $(enterpriseTestsSetup)
64-
docker-compose down
65-
displayName: Stop test network and machines
66-
env:
67-
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
67+
- bash: |
68+
cd $(enterpriseTestsSetup)
69+
docker-compose down
70+
displayName: Stop test network and machines
71+
env:
72+
DOTNET_RUNTIME_REPO_ROOT: $(Build.SourcesDirectory)
6873
69-
- task: PublishTestResults@2
70-
inputs:
71-
testRunner: 'xUnit'
72-
testResultsFiles: '**/testResults.xml'
73-
testRunTitle: 'Enterprise Tests'
74-
mergeTestResults: true
75-
failTaskOnFailedTests: true
74+
- task: PublishTestResults@2
75+
inputs:
76+
testRunner: 'xUnit'
77+
testResultsFiles: '**/testResults.xml'
78+
testRunTitle: 'Enterprise Tests'
79+
mergeTestResults: true
80+
failTaskOnFailedTests: true

src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:18.04
1+
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20220421022739-9c434db
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

src/libraries/Common/tests/System/Net/EnterpriseTests/setup/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ services:
6060
hostname: linuxclient
6161
domainname: linux.contoso.com
6262
dns_search: linux.contoso.com
63+
privileged: true
64+
dns:
65+
- 8.8.8.8
6366
volumes:
6467
- shared-volume:/SHARED
6568
- ${DOTNET_RUNTIME_REPO_ROOT}:/repo

src/libraries/Common/tests/System/Net/EnterpriseTests/setup/kdc/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:18.04
1+
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20220421022739-9c434db
22

33
COPY ./kdc/kadm5.acl /etc/krb5kdc/
44
COPY ./kdc/kdc.conf /etc/krb5kdc/

src/libraries/Common/tests/System/Net/EnterpriseTests/setup/linuxclient/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20211022152710-047508b
1+
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20220421022739-9c434db
22

33
# Prevents dialog prompting when installing packages
44
ARG DEBIAN_FRONTEND=noninteractive

src/libraries/Common/tests/System/Net/EnterpriseTests/setup/linuxclient/test-webserver.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ kdestroy
44
echo password | kinit user1
55
curl --verbose --negotiate -u: http://apacheweb.linux.contoso.com
66
kdestroy
7+
8+
nslookup github.com
9+

0 commit comments

Comments
 (0)