author | herrick |
Wed, 23 Oct 2019 10:10:34 -0400 | |
branch | JDK-8200758-branch |
changeset 58761 | 88e2753a2334 |
parent 58417 | 67ffaf3a2b75 |
child 58994 | b09ba68c6a19 |
permissions | -rw-r--r-- |
58113 | 1 |
/* |
2 |
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
58416 | 24 |
import jdk.jpackage.test.TKit; |
58113 | 25 |
import jdk.jpackage.test.PackageTest; |
26 |
import jdk.jpackage.test.PackageType; |
|
58417
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
27 |
import jdk.jpackage.test.LinuxHelper; |
58113 | 28 |
|
29 |
||
30 |
/** |
|
31 |
* Test --linux-package-deps parameter. Output of the test should be |
|
32 |
* apackagedepstestprereq_1.0-1_amd64.deb and packagedepstest_1.0-1_amd64.deb or |
|
33 |
* apackagedepstestprereq-1.0-1.amd64.rpm and packagedepstest-1.0-1.amd64.rpm |
|
34 |
* package bundles. The output packages should provide the same functionality as |
|
35 |
* the default package. |
|
36 |
* |
|
37 |
* deb: Value of Depends property of packagedepstest package should contain |
|
38 |
* apackagedepstestprereq word. |
|
39 |
* |
|
40 |
* rpm: Value of Requires property of packagedepstest package should contain |
|
41 |
* apackagedepstestprereq word. |
|
42 |
*/ |
|
43 |
||
44 |
||
45 |
/* |
|
46 |
* @test |
|
47 |
* @summary jpackage with --linux-package-deps |
|
48 |
* @library ../helpers |
|
58761
88e2753a2334
8231972: Build a stable list of jpackager tests for SQE
herrick
parents:
58417
diff
changeset
|
49 |
* @key jpackagePlatformPackage |
58416 | 50 |
* @build jdk.jpackage.test.* |
58113 | 51 |
* @requires (os.family == "linux") |
52 |
* @modules jdk.jpackage/jdk.jpackage.internal |
|
53 |
* @run main/othervm/timeout=360 -Xmx512m PackageDepsTest |
|
54 |
*/ |
|
55 |
public class PackageDepsTest { |
|
56 |
||
58301
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
57 |
public static void main(String[] args) { |
58416 | 58 |
// Pick the name of prerequisite package to be alphabetically |
59 |
// preceeding the main package name. |
|
60 |
// This is needed to make Bash script batch installing/uninstalling packages |
|
61 |
// produced by jtreg tests install/uninstall packages in the right order. |
|
58113 | 62 |
final String PREREQ_PACKAGE_NAME = "apackagedepstestprereq"; |
63 |
||
58416 | 64 |
TKit.run(args, () -> { |
65 |
new PackageTest() |
|
66 |
.forTypes(PackageType.LINUX) |
|
67 |
.configureHelloApp() |
|
68 |
.addInitializer(cmd -> { |
|
69 |
cmd.setArgumentValue("--name", PREREQ_PACKAGE_NAME); |
|
70 |
}) |
|
71 |
.run(); |
|
58113 | 72 |
|
58301
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
73 |
new PackageTest() |
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
74 |
.forTypes(PackageType.LINUX) |
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
75 |
.configureHelloApp() |
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
76 |
.addInitializer(cmd -> { |
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
77 |
cmd.addArguments("--linux-package-deps", PREREQ_PACKAGE_NAME); |
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
78 |
}) |
58417
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
79 |
.forTypes(PackageType.LINUX) |
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
80 |
.addBundleVerifier(cmd -> { |
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
81 |
TKit.assertTrue( |
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
82 |
LinuxHelper.getPrerequisitePackages(cmd).contains( |
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
83 |
PREREQ_PACKAGE_NAME), String.format( |
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
84 |
"Check package depends on [%s] package", |
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
85 |
PREREQ_PACKAGE_NAME)); |
67ffaf3a2b75
8231280: Linux packages produced by jpackage should have correct dependencies
herrick
parents:
58416
diff
changeset
|
86 |
}) |
58301
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
87 |
.run(); |
e0efb29609bd
8225249 : LinuxDebBundler and LinuxRpmBundler should share more code
herrick
parents:
58113
diff
changeset
|
88 |
}); |
58113 | 89 |
} |
90 |
} |