-
Notifications
You must be signed in to change notification settings - Fork 25
/
TestRpmMetaValidation.groovy
62 lines (56 loc) · 2.77 KB
/
TestRpmMetaValidation.groovy
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
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
import jenkins.tests.BuildPipelineTest
import org.junit.Before
import org.junit.Test
class TestRpmMetaValidation extends BuildPipelineTest {
@Before
void setUp() {
def rpmDistribution = "$workspace/opensearch-1.3.1-linux-x64.rpm"
def refMap = [Name:"opensearch", Version: "1.3.1", Architecture: "x64", Group: "Application/Internet",
License: "Apache-2.0", Relocations: "(not relocatable)", URL: "https://opensearch.org/",
Summary: "An open source distributed and RESTful search engine",
Description: "OpenSearch makes it easy to ingest, search, visualize, and analyze your data\n" +
"For more information, see: https://opensearch.org/"
]
this.registerLibTester(new RpmMetaValidationLibTester(rpmDistribution, refMap))
super.setUp()
def out = "Name : opensearch\n" +
"Version : 1.3.1\n" +
"Release : 1\n" +
"Architecture: x86_64\n" +
"Install Date: (not installed)\n" +
"Group : Application/Internet\n" +
"Size : 646503829\n" +
"License : Apache-2.0\n" +
"Signature : (none)\n" +
"Source RPM : opensearch-1.3.1-1.src.rpm\n" +
"Build Date : Wed Mar 23 22:10:17 2022\n" +
"Build Host : f8a4d27a00d9\n" +
"Relocations : (not relocatable)\n" +
"URL : https://opensearch.org/\n" +
"Summary : An open source distributed and RESTful search engine\n" +
"Description :\n" +
"OpenSearch makes it easy to ingest, search, visualize, and analyze your data\n" +
"For more information, see: https://opensearch.org/"
helper.addShMock("rpm -qip $workspace/opensearch-1.3.1-linux-x64.rpm") { script ->
return [stdout: out, exitValue: 0]
}
def sigOut = "/tmp/workspace/opensearch-1.3.1-linux-x64.rpm:\n" + "Header V4 RSA/SHA512 Signature, key ID 9310d3fc: OK\n" +
"Header SHA256 digest: OK\n" + "Header SHA1 digest: OK\n" + "Payload SHA256 digest: OK\n" +
"V4 RSA/SHA512 Signature, key ID 9310d3fc: OK\n" + "MD5 digest: OK"
helper.addShMock("rpm -K -v $rpmDistribution") { script ->
return [stdout: sigOut, exitValue: 0]
}
}
@Test
void testRpmMetaValidation() {
super.testPipeline("tests/jenkins/jobs/RpmMetaValidation_Jenkinsfile")
}
}