RFR: JDK-8229840: Add jtreg test for --linux-app-category option
Alexey Semenyuk
alexey.semenyuk at oracle.com
Fri Aug 30 21:55:47 UTC 2019
Please review the jpackage fix for bug [1] at [2].
This is a fix for the JDK-8200758-branch branch of the open sandbox
repository (jpackage).
- added jtreg test for --linux-app-category option;
- added jtreg test for --linux-release option; This is to address [3] issue;
- introduced helper classes to simplify adding new jtreg tests. The
helper classes allow to avoid code duplication between platform specific
jpackage jtreg tests. They also allow to log actions taken by tests.
Test output for package bundle creation:
---
TRACE: assertTrue(): Check value of jpackage.test.output property
[/home/asemenyu/jpackage_tests] references a directory
TRACE: assertTrue(): Check value of jpackage.test.output property
[/home/asemenyu/jpackage_tests] references writable directory
TRACE: Bundler deb supported
TRACE: Execute [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/javac];
args(3)=[-d, /tmp/jpackage_15808073035885342403,
/media/sf_jds/work/10_sandbox/jdk10/open/test/jdk/tools/jpackage/linux/base/../../apps/image/Hello.java]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command
[/home/asemenyu/work/10_sandbox/64/images/jdk/bin/javac]; args(3)=[-d,
/tmp/jpackage_15808073035885342403,
/media/sf_jds/work/10_sandbox/jdk10/open/test/jdk/tools/jpackage/linux/base/../../apps/image/Hello.java]
exited with 0 code
TRACE: Execute [/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jar];
args(9)=[-c, -v, -f, /tmp/jpackage_15808073035885342403/foo.jar, -e,
Hello, -C, /tmp/jpackage_15808073035885342403, .]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command
[/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jar]; args(9)=[-c, -v,
-f, /tmp/jpackage_15808073035885342403/foo.jar, -e, Hello, -C,
/tmp/jpackage_15808073035885342403, .] exited with 0 code
TRACE: Execute
[/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jpackage];
args(14)=[--input, ./input, --output, /home/asemenyu/jpackage_tests,
--name, ReleaseTest, --package-type, deb, --linux-app-release, Rc3,
--main-jar, hello.jar, --main-class, Hello]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command
[/home/asemenyu/work/10_sandbox/64/images/jdk/bin/jpackage];
args(14)=[--input, ./input, --output, /home/asemenyu/jpackage_tests,
--name, ReleaseTest, --package-type, deb, --linux-app-release, Rc3,
--main-jar, hello.jar, --main-class, Hello] exited with 0 code
TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output
to [/tmp/jpackage_10813571496694787689.out]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command [dpkg];
args(1)=[--print-architecture] exited with 0 code
TRACE: assertTrue(): Check file
[/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exists
TRACE: Execute [dpkg-deb]; args(3)=[-f,
/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb, Version];
redirect output to [/tmp/jpackage_17295015055550147798.out]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command [dpkg-deb]; args(3)=[-f,
/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb, Version]
exited with 0 code
TRACE: assertTrue(): Check value of Version field [1.0-Rc3] ends with Rc3
---
Test output for package installation verification:
---
TRACE: assertTrue(): Check value of jpackage.test.output property
[/home/asemenyu/jpackage_tests] references a directory
TRACE: assertTrue(): Check value of jpackage.test.output property
[/home/asemenyu/jpackage_tests] references writable directory
TRACE: Bundler deb supported
TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output
to [/tmp/jpackage_1127921622487705754.out]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command [dpkg];
args(1)=[--print-architecture] exited with 0 code
TRACE: Execute [dpkg]; args(2)=[--contents,
/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect
output to [/tmp/jpackage_16221854689490241666.out]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents,
/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited with
0 code
TRACE: assertTrue(): Check application launcher
[/opt/releasetest/bin/ReleaseTest] is a file
TRACE: assertTrue(): Check application launcher
[/opt/releasetest/bin/ReleaseTest] can be executed
TRACE: Execute [dpkg]; args(2)=[--contents,
/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect
output to [/tmp/jpackage_12615070579893278257.out]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents,
/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited with
0 code
TRACE: Execute [/opt/releasetest/bin/ReleaseTest]; args(0)=[]; in
directory [.]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command
[/opt/releasetest/bin/ReleaseTest]; args(0)=[] exited with 0 code
TRACE: assertTrue(): Check file [./appOutput.txt] exists
TRACE: assertEquals(2): Check file [./appOutput.txt] contains 2 text lines
TRACE: assertEquals(jpackage test application): Check contents of the
first text line in [./appOutput.txt] file
TRACE: assertEquals(args.length: 0): Check contents of the second text
line in [./appOutput.txt] file
---
Test output for package uninstallation verification:
---
TRACE: assertTrue(): Check value of jpackage.test.output property
[/home/asemenyu/jpackage_tests] references a directory
TRACE: assertTrue(): Check value of jpackage.test.output property
[/home/asemenyu/jpackage_tests] references writable directory
TRACE: Bundler deb supported
TRACE: Execute [dpkg]; args(1)=[--print-architecture]; redirect output
to [/tmp/jpackage_13235248864123060580.out]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command [dpkg];
args(1)=[--print-architecture] exited with 0 code
TRACE: Execute [dpkg]; args(2)=[--contents,
/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb]; redirect
output to [/tmp/jpackage_5913837318202811095.out]...
TRACE: Done. Exit code: 0
TRACE: assertEquals(0): Check command [dpkg]; args(2)=[--contents,
/home/asemenyu/jpackage_tests/releasetest_1.0-Rc3_amd64.deb] exited with
0 code
TRACE: assertFalse(): Check application launcher
[/opt/releasetest/bin/ReleaseTest] is not installed
TRACE: assertFalse(): Check application installation directory
[/opt/releasetest] is not available
---
[1] https://bugs.openjdk.java.net/browse/JDK-8229840
[2] http://cr.openjdk.java.net/~asemenyuk/8229840/webrev.02
[3] https://bugs.openjdk.java.net/browse/JDK-8229841
Thanks,
Alexey
More information about the core-libs-dev
mailing list