forked from sonic-net/sonic-sairedis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-docker-sonic-vs-template.yml
More file actions
78 lines (65 loc) · 2.17 KB
/
Copy pathtest-docker-sonic-vs-template.yml
File metadata and controls
78 lines (65 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
parameters:
- name: timeout
type: number
default: 360
- name: log_artifact_name
type: string
jobs:
- job:
displayName: vstest
timeoutInMinutes: ${{ parameters.timeout }}
pool: sonic-common
steps:
- script: |
ls -A1 | xargs -I{} sudo rm -rf {}
displayName: "Clean workspace"
- checkout: self
- task: DownloadPipelineArtifact@2
inputs:
artifact: docker-sonic-vs
displayName: "Download docker sonic vs image"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 9
artifact: sonic-swss-common.amd64.ubuntu20_04
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic swss common deb packages"
- checkout: self
displayName: "Checkout sonic-sairedis"
- checkout: sonic-swss
displayName: "Checkout sonic-swss"
- script: |
set -x
sudo sonic-sairedis/.azure-pipelines/build_and_install_module.sh
sudo apt-get install -y libhiredis0.14
sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb || apt-get install -f
sudo dpkg -i ../python3-swsscommon_1.0.0_amd64.deb
# install packages for vs test
sudo apt-get install -y net-tools bridge-utils vlan
sudo apt-get install -y python3-pip
sudo pip3 install pytest==4.6.2 attrs==19.1.0 exabgp==4.0.10 distro==1.5.0 docker==4.4.1 redis==3.3.4 flaky==3.7.0
displayName: "Install dependencies"
- script: |
set -x
sudo docker load -i ../docker-sonic-vs.gz
docker ps
ip netns list
pushd sonic-swss/tests
sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
displayName: "Run vs tests"
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/tr.xml'
testRunTitle: vstest
condition: always()
- script: |
cp -r sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
displayName: "Collect logs"
condition: always()
- publish: $(Build.ArtifactStagingDirectory)/
artifact: ${{ parameters.log_artifact_name }}@$(System.JobAttempt)
displayName: "Publish logs"
condition: always()