diff options
author | Tim Foster <tim.foster@joyent.com> | 2019-09-30 16:04:38 +0100 |
---|---|---|
committer | Tim Foster <tim.foster@joyent.com> | 2019-10-01 18:07:10 +0100 |
commit | 55ab1f46247112915c7bce57eb4ac36c537bdbdd (patch) | |
tree | 28bca75a8b8fdbef770e225cb34fb6657da3793c | |
parent | a3b6d741ed7fe1b635d05c080dfcffda671d56c8 (diff) | |
download | illumos-joyent-test_archive.tar.gz |
OS-7943 Want platform build test artifacttest_archive
19 files changed, 719 insertions, 19 deletions
diff --git a/usr/src/Makefile.testarchive b/usr/src/Makefile.testarchive new file mode 100644 index 0000000000..fe995d9be7 --- /dev/null +++ b/usr/src/Makefile.testarchive @@ -0,0 +1,35 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# Copyright 2019 Joyent, Inc. +# + +# +# Used by smartos-live.git, this Makefile simply defines a macro +# that contains the set of illumos-joyent tests that get built +# into the test archive deliverable. +# +TEST_IPS_MANIFEST_FILES = \ + system-bhyve-tests.mf \ + system-dtrace-tests.mf \ + system-file-system-zfs-tests.mf \ + system-io-tests.mf \ + system-test-cryptotest.mf \ + system-test-elftest.mf \ + system-test-libctest.mf \ + system-test-nettest.mf \ + system-test-ostest.mf \ + system-test-smbclient.mf \ + system-test-testrunner.mf \ + system-test-utiltest.mf \ + system-test-vndtest.mf \ + system-test-smartostest.mf \ + system-test-zfstest.mf + diff --git a/usr/src/cmd/vndadm/test/scripts/vndtest.ksh b/usr/src/cmd/vndadm/test/scripts/vndtest.ksh index 1167a64802..224306ffe9 100755 --- a/usr/src/cmd/vndadm/test/scripts/vndtest.ksh +++ b/usr/src/cmd/vndadm/test/scripts/vndtest.ksh @@ -11,7 +11,7 @@ # # -# Copyright (c) 2014, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # # @@ -199,9 +199,7 @@ function run_all { typeset tests t dir - cd $vt_root || fatal "failed to enter root test directory" - tests=$(ls -1 */*/@(ecreate|create|tst|err).*.@(ksh|exe)) - cd - > /dev/null + tests=$(ls -1 $vt_root/*/*/@(ecreate|create|tst|err).*.@(ksh|exe)) for t in $tests; do run_single $t done diff --git a/usr/src/pkg/manifests/system-dtrace-tests.mf b/usr/src/pkg/manifests/system-dtrace-tests.mf index 535fa88ca9..bc179334a5 100644 --- a/usr/src/pkg/manifests/system-dtrace-tests.mf +++ b/usr/src/pkg/manifests/system-dtrace-tests.mf @@ -22,7 +22,7 @@ # # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012, 2016 by Delphix. All rights reserved. -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # set name=pkg.fmri value=pkg:/system/dtrace/tests@$(PKGVERS) @@ -1598,8 +1598,6 @@ file path=opt/SUNWdtrt/tst/common/scalars/tst.16kglobal.d mode=0444 file path=opt/SUNWdtrt/tst/common/scalars/tst.16klocal.d mode=0444 file path=opt/SUNWdtrt/tst/common/scalars/tst.basicvar.d mode=0444 file path=opt/SUNWdtrt/tst/common/scalars/tst.basicvar.d.out mode=0444 -file path=opt/SUNWdtrt/tst/common/scalars/err.bigglobal.d mode=0444 -file path=opt/SUNWdtrt/tst/common/scalars/err.biglocal.d mode=0444 file path=opt/SUNWdtrt/tst/common/scalars/tst.localvar.d mode=0444 file path=opt/SUNWdtrt/tst/common/scalars/tst.misc.d mode=0444 file path=opt/SUNWdtrt/tst/common/scalars/tst.self.d mode=0444 diff --git a/usr/src/pkg/manifests/system-test-cryptotest.mf b/usr/src/pkg/manifests/system-test-cryptotest.mf index 9b4d8153b9..12c67a7349 100644 --- a/usr/src/pkg/manifests/system-test-cryptotest.mf +++ b/usr/src/pkg/manifests/system-test-cryptotest.mf @@ -32,6 +32,9 @@ dir path=opt/crypto-tests/tests/aes/pkcs group=root mode=0755 owner=root dir path=opt/crypto-tests/tests/digest dir path=opt/crypto-tests/tests/digest/kcf dir path=opt/crypto-tests/tests/digest/pkcs +dir path=opt/crypto-tests/tests/hmac +dir path=opt/crypto-tests/tests/hmac/kcf +dir path=opt/crypto-tests/tests/hmac/pkcs file path=opt/crypto-tests/README mode=0444 file path=opt/crypto-tests/bin/cryptotest mode=0555 file path=opt/crypto-tests/runfiles/default.run mode=0444 @@ -166,6 +169,12 @@ file opt/crypto-tests/tests/digest/pkcs/sha512_32 \ file opt/crypto-tests/tests/digest/pkcs/sha512_64 \ path=opt/crypto-tests/tests/digest/pkcs/sha512_64 group=root mode=0555 \ owner=root +file path=opt/crypto-tests/tests/hmac/kcf/cleanup mode=0555 +file path=opt/crypto-tests/tests/hmac/kcf/hmac_sha1_32 mode=0555 +file path=opt/crypto-tests/tests/hmac/kcf/hmac_sha1_64 mode=0555 +file path=opt/crypto-tests/tests/hmac/kcf/setup mode=0555 +file path=opt/crypto-tests/tests/hmac/pkcs/hmac_sha1_32 mode=0555 +file path=opt/crypto-tests/tests/hmac/pkcs/hmac_sha1_64 mode=0555 license cr_Sun license=cr_Sun license lic_CDDL license=lic_CDDL depend fmri=driver/crypto/dprov type=require diff --git a/usr/src/pkg/manifests/system-test-libctest.mf b/usr/src/pkg/manifests/system-test-libctest.mf index e322646bcb..a4a2daaf43 100644 --- a/usr/src/pkg/manifests/system-test-libctest.mf +++ b/usr/src/pkg/manifests/system-test-libctest.mf @@ -87,6 +87,8 @@ file path=opt/libc-tests/tests/endian.32 mode=0555 file path=opt/libc-tests/tests/endian.64 mode=0555 file path=opt/libc-tests/tests/env-7076.32 mode=0555 file path=opt/libc-tests/tests/env-7076.64 mode=0555 +file path=opt/libc-tests/tests/env-OS-4089.32 mode=0555 +file path=opt/libc-tests/tests/env-OS-4089.64 mode=0555 file path=opt/libc-tests/tests/fnmatch.32 mode=0555 file path=opt/libc-tests/tests/fnmatch.64 mode=0555 file path=opt/libc-tests/tests/fpround_test mode=0555 diff --git a/usr/src/pkg/manifests/system-test-nettest.mf b/usr/src/pkg/manifests/system-test-nettest.mf new file mode 100644 index 0000000000..acc4cab0c6 --- /dev/null +++ b/usr/src/pkg/manifests/system-test-nettest.mf @@ -0,0 +1,54 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2019 Joyent, Inc. +# + +set name=pkg.fmri value=pkg:/system/test/nettest@$(PKGVERS) +set name=pkg.description value="net-tests" +set name=pkg.summary value="net-tests execution" +set name=info.classification \ + value=org.opensolaris.category.2008:Development/System +set name=variant.arch value=$(ARCH) +dir path=opt/net-tests +dir path=opt/net-tests/bin +dir path=opt/net-tests/config +dir path=opt/net-tests/runfiles +dir path=opt/net-tests/tests +dir path=opt/net-tests/tests/forwarding +file path=opt/net-tests/bin/nettest mode=0555 +file path=opt/net-tests/config/ip_forwarding.config +file path=opt/net-tests/runfiles/default.run +file path=opt/net-tests/tests/forwarding/ip_forwarding mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_001 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_002 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_003 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_004 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_005 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_006 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_007 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_008 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_009 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_010 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_011 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_012 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_013 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_014 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_015 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_016 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_017 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_018 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_019 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_020 mode=0555 +file path=opt/net-tests/tests/forwarding/ip_fwd_suite mode=0555 +file path=opt/net-tests/tests/forwarding/README +file path=opt/net-tests/tests/net_common diff --git a/usr/src/pkg/manifests/system-test-ostest.mf b/usr/src/pkg/manifests/system-test-ostest.mf index 38fd6b78b9..8a161e98f7 100644 --- a/usr/src/pkg/manifests/system-test-ostest.mf +++ b/usr/src/pkg/manifests/system-test-ostest.mf @@ -38,6 +38,9 @@ dir path=opt/os-tests/tests/stress file path=opt/os-tests/README mode=0444 file path=opt/os-tests/bin/ostest mode=0555 file path=opt/os-tests/runfiles/default.run mode=0444 +file path=opt/os-tests/tests/imc_test mode=0555 +file path=opt/os-tests/tests/OS-6097.32 mode=0555 +file path=opt/os-tests/tests/OS-6097.64 mode=0555 file path=opt/os-tests/tests/ddi_ufm/ufm-test mode=0555 file path=opt/os-tests/tests/ddi_ufm/ufm-test-cleanup mode=0555 file path=opt/os-tests/tests/ddi_ufm/ufm-test-setup mode=0555 diff --git a/usr/src/pkg/manifests/system-test-smartostest.mf b/usr/src/pkg/manifests/system-test-smartostest.mf new file mode 100644 index 0000000000..71b34c5b54 --- /dev/null +++ b/usr/src/pkg/manifests/system-test-smartostest.mf @@ -0,0 +1,49 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2019 Joyent, Inc. +# + +# +# The SmartOS test package is expressly intended *not* to be +# installable on other distributions, and should not be +# up-streamed to the illumos-gate. Notably since it redelivers +# isaexec and ctfconvert, this violates IPS requirements that +# only a single package deliver a given file, unless IPS +# variants are used. +# Instead, this package is used during the 'smartos-live' +# build to generate a SmartOS manifest which delivers the +# prerequisites needed to create an installable tarball of +# the tests from the gate proto area. +# +set name=pkg.fmri value=pkg:/system/test/smartostest@$(PKGVERS) +set name=pkg.description value="SmartOS test setup and execution" +set name=pkg.summary value="SmartOS test execution" +set name=info.classification \ + value=org.opensolaris.category.2008:Development/System +set name=variant.arch value=$(ARCH) +dir path=opt owner=root group=sys +dir path=opt/smartos-test +dir path=opt/smartos-test/bin +file path=opt/smartos-test/README mode=0444 +file path=opt/smartos-test/bin/smartos-test mode=0555 +# Needed by the /opt/utils-test suite +file path=usr/bin/ctfconvert mode=0555 +file path=usr/bin/ctfmerge mode=0555 +# The libc-tests attempt to forge a hardlink to isaexec +# so we need to redeliver isaexec in order to create the +# proto area correctly. +file path=usr/lib/isaexec + +license cr_Sun license=cr_Sun +license lic_CDDL license=lic_CDDL +depend fmri=system/test/testrunner type=require diff --git a/usr/src/pkg/manifests/system-test-utiltest.mf b/usr/src/pkg/manifests/system-test-utiltest.mf index d5ec587910..64bcc8b6f4 100644 --- a/usr/src/pkg/manifests/system-test-utiltest.mf +++ b/usr/src/pkg/manifests/system-test-utiltest.mf @@ -15,7 +15,7 @@ # Copyright 2014 Nexenta Systems, Inc. All rights reserved. # Copyright 2019, Joyent, Inc. # Copyright 2017 Jason King. -# Copyright 2018, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # set name=pkg.fmri value=pkg:/system/test/utiltest@$(PKGVERS) @@ -37,6 +37,7 @@ dir path=opt/util-tests/tests/awk/examples/out dir path=opt/util-tests/tests/awk/gnu dir path=opt/util-tests/tests/awk/syn dir path=opt/util-tests/tests/awk/tests +dir path=opt/util-tests/tests/bunyan dir path=opt/util-tests/tests/ctf dir path=opt/util-tests/tests/ctf/test-merge-dedup dir path=opt/util-tests/tests/ctf/test-merge-forward @@ -62,6 +63,7 @@ dir path=opt/util-tests/tests/awk/syn dir path=opt/util-tests/tests/awk/tests dir path=opt/util-tests/tests/mergeq file path=opt/util-tests/README mode=0444 +file path=opt/util-tests/bin/btest mode=0555 file path=opt/util-tests/bin/print_json mode=0555 file path=opt/util-tests/bin/utiltest mode=0555 file path=opt/util-tests/runfiles/default.run mode=0444 @@ -80,7 +82,6 @@ file path=opt/util-tests/tests/awk/bugs-fixed/nf-self-assign.awk mode=0444 file path=opt/util-tests/tests/awk/bugs-fixed/nf-self-assign.ok mode=0444 file path=opt/util-tests/tests/awk/bugs-fixed/numeric-fs.awk mode=0444 file path=opt/util-tests/tests/awk/bugs-fixed/numeric-fs.ok mode=0444 -file path=opt/util-tests/tests/awk/bugs-fixed/numeric-output-seps.awk mode=0444 file path=opt/util-tests/tests/awk/bugs-fixed/numeric-output-seps.awk \ mode=0444 file path=opt/util-tests/tests/awk/bugs-fixed/numeric-output-seps.ok mode=0444 @@ -1086,6 +1087,7 @@ file path=opt/util-tests/tests/awk/tests/penicil.ok mode=0444 file path=opt/util-tests/tests/awk/tests/penicil.p mode=0444 file path=opt/util-tests/tests/awk/tests/res.ok mode=0444 file path=opt/util-tests/tests/awk/tests/res.p mode=0444 +file path=opt/util-tests/tests/bunyan/bunyan mode=0555 file path=opt/util-tests/tests/chown_test mode=0555 file path=opt/util-tests/tests/ctf/Makefile.ctftest.com mode=0555 file path=opt/util-tests/tests/ctf/check-array mode=0555 @@ -1461,7 +1463,9 @@ file path=opt/util-tests/tests/mergeq/mqt mode=0555 file path=opt/util-tests/tests/mergeq/wqt mode=0555 file path=opt/util-tests/tests/printf_test mode=0555 file path=opt/util-tests/tests/set-linkprop mode=0555 +file path=opt/util-tests/tests/show-overlay-exit mode=0555 file path=opt/util-tests/tests/smbios mode=0555 +file path=opt/util-tests/tests/vnic-mtu mode=0555 file path=opt/util-tests/tests/xargs_test mode=0555 license lic_CDDL license=lic_CDDL license usr/src/lib/libdemangle/THIRDPARTYLICENSE \ diff --git a/usr/src/pkg/manifests/system-test-vndtest.mf b/usr/src/pkg/manifests/system-test-vndtest.mf new file mode 100644 index 0000000000..8f9b8804d9 --- /dev/null +++ b/usr/src/pkg/manifests/system-test-vndtest.mf @@ -0,0 +1,82 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2019 Joyent, Inc. +# + +set name=pkg.fmri value=pkg:/system/test/vndtest@$(PKGVERS) +set name=pkg.description value="vndtest" +set name=pkg.summary value="vndtest execution" +set name=info.classification \ + value=org.opensolaris.category.2008:Development/System +set name=variant.arch value=$(ARCH) +dir path=opt/vndtest +dir path=opt/vndtest/bin +dir path=opt/vndtest/tst +dir path=opt/vndtest/tst/cmd +dir path=opt/vndtest/tst/dld +dir path=opt/vndtest/tst/ioctl +dir path=opt/vndtest/tst/lib +file path=opt/vndtest/bin/vndtest mode=0555 +file path=opt/vndtest/tst/cmd/cmd.common.ksh mode=0555 +file path=opt/vndtest/tst/cmd/create.list.ksh mode=0555 +file path=opt/vndtest/tst/cmd/create.list.ksh.out mode=0555 +file path=opt/vndtest/tst/cmd/create.sdev.ksh mode=0555 +file path=opt/vndtest/tst/cmd/create.setbuf.ksh mode=0555 +file path=opt/vndtest/tst/cmd/ecreate.destroy.ksh mode=0555 +file path=opt/vndtest/tst/cmd/ecreate.setbadprop.ksh mode=0555 +file path=opt/vndtest/tst/cmd/ecreate.setbadvalue.ksh mode=0555 +file path=opt/vndtest/tst/cmd/ecreate.setbuftoobig.ksh mode=0555 +file path=opt/vndtest/tst/cmd/ecreate.setrdonlyprop.ksh mode=0555 +file path=opt/vndtest/tst/dld/create.reuse.ksh mode=0555 +file path=opt/vndtest/tst/dld/dld.common.ksh mode=0555 +file path=opt/vndtest/tst/dld/ecreate.ipfirst.ksh mode=0555 +file path=opt/vndtest/tst/dld/ecreate.vndfirst.ksh mode=0555 +file path=opt/vndtest/tst/ioctl/create.attach.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.attachnolink.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.badlinkname.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.doublelink.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.gioctlattach.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.link.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.linkexists.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.ngioctlfault.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.nopriv1.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.nopriv2.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.nopriv3.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.nopriv4.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.olink.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.olinknopriv.exe mode=0555 +file path=opt/vndtest/tst/ioctl/create.rmenolink.exe mode=0555 +file path=opt/vndtest/tst/ioctl/tst.attachrdonly.exe mode=0555 +file path=opt/vndtest/tst/ioctl/tst.badioctl.exe mode=0555 +file path=opt/vndtest/tst/ioctl/tst.basicopenctl.exe mode=0555 +file path=opt/vndtest/tst/ioctl/tst.gioctlfault.exe mode=0555 +file path=opt/vndtest/tst/ioctl/tst.gioctlnattach.exe mode=0555 +file path=opt/vndtest/tst/ioctl/tst.iocsize.ksh mode=0555 +file path=opt/vndtest/tst/ioctl/tst.openctlbadflags.exe mode=0555 +file path=opt/vndtest/tst/lib/create.badlink.exe mode=0555 +file path=opt/vndtest/tst/lib/create.badpropid.exe mode=0555 +file path=opt/vndtest/tst/lib/create.badpropsize.exe mode=0555 +file path=opt/vndtest/tst/lib/create.badzone.exe mode=0555 +file path=opt/vndtest/tst/lib/create.basic.exe mode=0555 +file path=opt/vndtest/tst/lib/create.enomem.exe mode=0555 +file path=opt/vndtest/tst/lib/create.frameioeagain.exe mode=0555 +file path=opt/vndtest/tst/lib/create.open.exe mode=0555 +file path=opt/vndtest/tst/lib/create.propiter.exe mode=0555 +file path=opt/vndtest/tst/lib/create.proprdonly.exe mode=0555 +file path=opt/vndtest/tst/lib/err.badclose.exe mode=0555 +file path=opt/vndtest/tst/lib/tst.badopen.exe mode=0555 +file path=opt/vndtest/tst/lib/tst.strerror.exe mode=0555 +file path=opt/vndtest/tst/lib/tst.strerror.exe.out mode=0555 +file path=opt/vndtest/tst/lib/tst.strsyserror.exe mode=0555 +license cr_Sun license=cr_Sun +license lic_CDDL license=lic_CDDL diff --git a/usr/src/test/Makefile b/usr/src/test/Makefile index 9756f02ef7..ad41f89400 100644 --- a/usr/src/test/Makefile +++ b/usr/src/test/Makefile @@ -23,6 +23,7 @@ SUBDIRS = \ libc-tests \ net-tests \ os-tests \ + smartos-test \ smbclient-tests \ test-runner \ util-tests \ diff --git a/usr/src/test/Readme.smartos b/usr/src/test/Readme.smartos index 85f33e7886..2410ff9158 100644 --- a/usr/src/test/Readme.smartos +++ b/usr/src/test/Readme.smartos @@ -10,7 +10,7 @@ # # -# Copyright 2018, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # I) Introduction @@ -19,6 +19,9 @@ The procedure to run the illumos tests under SmartOS is unlike that for other distributions because of the zone-centric nature of the distribution, and because there is no built-in package management for the global zone. +XXX timf: talk about how to install the smartos-tests package and run +the wrapper that installs the prerequisites and runs the tests. + This Readme assumes you will run the tests in the global zone, as root. Although it is possible to run some of the tests within a non-global zone, as a user configured within that zone, that approach is not described here. diff --git a/usr/src/test/crypto-tests/cmd/kcf/Makefile b/usr/src/test/crypto-tests/cmd/kcf/Makefile index 3964744d24..8ae7c35786 100644 --- a/usr/src/test/crypto-tests/cmd/kcf/Makefile +++ b/usr/src/test/crypto-tests/cmd/kcf/Makefile @@ -12,7 +12,7 @@ # # Copyright (c) 2012 by Delphix. All rights reserved. # Copyright 2015 Nexenta Systems, Inc. All rights reserved. -# Copyright (c) 2018, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # include $(SRC)/Makefile.master @@ -21,11 +21,17 @@ include $(SRC)/test/Makefile.com ROOTOPTPKG = $(ROOT)/opt/crypto-tests ROOTAES = $(ROOTOPTPKG)/tests/aes/kcf ROOTDIGEST = $(ROOTOPTPKG)/tests/digest/kcf -ROOTDIRS = $(ROOTAES) $(ROOTDIGEST) +ROOTHMAC = $(ROOTOPTPKG)/tests/hmac/kcf + +ROOTDIRS = $(ROOTAES) $(ROOTDIGEST) $(ROOTHMAC) PROGS = cleanup setup -CMDS = $(PROGS:%=$(ROOTAES)/%) $(PROGS:%=$(ROOTDIGEST)/%) +CMDS = \ + $(PROGS:%=$(ROOTAES)/%) \ + $(PROGS:%=$(ROOTDIGEST)/%) \ + $(PROGS:%=$(ROOTHMAC)/%) + $(CMDS) := FILEMODE = 0555 all lint clean clobber: @@ -41,3 +47,6 @@ $(ROOTAES)/%: %.ksh $(INS.rename) $(ROOTDIGEST)/%: %.ksh $(INS.rename) +$(ROOTHMAC)/%: %.ksh + $(INS.rename) + diff --git a/usr/src/test/os-tests/tests/secflags/secflags_dts.sh b/usr/src/test/os-tests/tests/secflags/secflags_dts.sh index b140943145..056769e61c 100644 --- a/usr/src/test/os-tests/tests/secflags/secflags_dts.sh +++ b/usr/src/test/os-tests/tests/secflags/secflags_dts.sh @@ -12,6 +12,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2019 Joyent, Inc. tmpdir=/tmp/test.$$ mkdir $tmpdir @@ -36,12 +37,12 @@ main(int argc, char **argv) } EOF -gcc -o tester-aslr tester.c -Wl,-z,aslr=enabled -gcc -o tester-noaslr tester.c -Wl,-z,aslr=disabled +gcc -m32 -o tester-aslr tester.c -Wl,-z,aslr=enabled +gcc -m32 -o tester-noaslr tester.c -Wl,-z,aslr=disabled # This is the easiest way I've found to get many many DTs, but it's gross -gcc -o many-dts-aslr tester.c -Wl,-z,aslr=enabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done) -gcc -o many-dts-noaslr tester.c -Wl,-z,aslr=disabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done) +gcc -m32 -o many-dts-aslr tester.c -Wl,-z,aslr=enabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done) +gcc -m32 -o many-dts-noaslr tester.c -Wl,-z,aslr=disabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done) check() { bin=$1 diff --git a/usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh b/usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh index 3ea807f9ae..699b4fe04a 100644 --- a/usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh +++ b/usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh @@ -12,14 +12,20 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2019 Joyent, Inc. # Verify that zones can be configured with security-flags LC_ALL=C # Collation is important +IS_SMARTOS=$(uname -v | grep ^joyent_) +if [[ -z "$IS_SMARTOS" ]]; then + create_flag="-b" +fi + expect_success() { name=$1 - (echo "create -b"; + (echo "create $create_flag"; echo "set zonepath=/$name.$$"; cat /dev/stdin; echo "verify"; @@ -46,7 +52,7 @@ expect_fail() { name=$1 expect=$2 - (echo "create -b"; + (echo "create $create_flag"; echo "set zonepath=/$name.$$"; cat /dev/stdin; echo "verify"; diff --git a/usr/src/test/smartos-test/Makefile b/usr/src/test/smartos-test/Makefile new file mode 100644 index 0000000000..a182a3a118 --- /dev/null +++ b/usr/src/test/smartos-test/Makefile @@ -0,0 +1,49 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2019 Joyent, Inc. +# + +include $(SRC)/Makefile.master +include ../Makefile.com + +PROGS= smartos-test +FILES= README + +ROOTOPTPKG = $(ROOT)/opt/smartos-test +ROOTBIN = $(ROOTOPTPKG)/bin + +ROOTPROGS= $(PROGS:%=$(ROOTBIN)/%) +$(ROOTPROGS) := FILEMODE = 0555 + +ROOTFILES= $(FILES:%=$(ROOTOPTPKG)/%) +$(ROOTFILES) := FILEMODE = 0444 + +all lint clean clobber: + +install: $(ROOTPROGS) $(ROOTFILES) + +$(ROOTPROGS): $(ROOTBIN) + +$(ROOTFILES): $(ROOTOPTPKG) + +$(ROOTBIN): + $(INS.dir) + +$(ROOTOPTPKG): + $(INS.dir) + +$(ROOTOPTPKG)/%: % + $(INS.file) + +$(ROOTBIN)/%: %.sh + $(INS.rename) diff --git a/usr/src/test/smartos-test/README b/usr/src/test/smartos-test/README new file mode 100644 index 0000000000..90d28417c3 --- /dev/null +++ b/usr/src/test/smartos-test/README @@ -0,0 +1,28 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2019 Joyent. Inc. +# + +Strictly speaking, this is not a set of tests. Rather, it is a wrapper that +automates most (but not all, in the case of zfs-test configuration!) of the +setup from $SRC/test/Readme.smartos. + +Specifically, the script here will: + +* setup loopback mounts for any files from the smartos "tests-[stamp].tgz" + file that need to be installed to a normally read-only location +* configure pkgsrc +* install required test packages +* execute tests that should all pass + +Over time, we will add to the set of tests that are executed. diff --git a/usr/src/test/smartos-test/smartos-test.sh b/usr/src/test/smartos-test/smartos-test.sh new file mode 100755 index 0000000000..a5bf6769fa --- /dev/null +++ b/usr/src/test/smartos-test/smartos-test.sh @@ -0,0 +1,367 @@ +#! /usr/bin/bash +# +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2019 Joyent, Inc. +# + +# +# This script is designed to run on an (effectively) disposable SmartOS +# install to configure the system, install a series of tests from the +# smartos-gate, and execute them. +# It exits 1 if any configuration, setup or test fails. +# + +export PATH=/usr/bin:/usr/sbin:/opt/tools/sbin:/opt/tools/bin:$PATH + +# The pkgsrc packages we will install. +export SMARTOS_TEST_PKGS=" + python27 + sudo + coreutils + gcc7 + gmake +" + +# +# Set $KEEP as a precaution in case we ever end up running the zfs-test suite +# by accident or design. This ensures it never attempts to destroy the 'zones' +# zpool. Note that the ZFS test suite also wants DISKS set to the disks which +# it can create/destroy pools on, but we're not computing that here. +# +if [[ -z "$KEEP" ]]; then + export KEEP="zones" +fi + +# +# Accumulate test suite exit codes and a list of failed tests +# +RESULT=0 +FAILED_TESTS="" + +function fatal { + echo "ERROR: $@" + exit 1 +} + +function warn { + echo "WARNING: $@" +} + +function log { + echo "$@" +} + +function log_must { + echo "Running $@" + $@ || fatal "Error running command." +} + +function log_test { + echo "" + TEST_NAME=$1 + shift + echo "Starting test for $TEST_NAME with $@" + $@ + TEST_RESULT=$? + if [[ $TEST_RESULT -ne 0 ]]; then + FAILED_TESTS="$FAILED_TESTS $TEST_NAME" + fi + RESULT=$(( $RESULT + $TEST_RESULT )) +} + +function log_testrunner { + echo "" + TEST_NAME=$1 + shift + echo "Starting test-runner for $TEST_NAME with $@" + /opt/test-runner/bin/run -c $@ + TEST_RESULT=$? + if [[ $TEST_RESULT -ne 0 ]]; then + FAILED_TESTS="$FAILED_TESTS $TEST_NAME" + fi + RESULT=$(( $RESULT + $TEST_RESULT )) + # test-runner's default log dirs use a timestamp at per-second granularity. + # Sleep here to ensure a unique timestamp per run if consecutive tests + # bail out early. + sleep 1 +} + +function guard_production_data { + + if [[ ! -f "/lib/sdc/.sdc-test-no-production-data" ]]; then + cat <<EOF +To setup and run these tests you must create the file: + /lib/sdc/.sdc-test-no-production-data +after ensuring you have no production data on this system. +EOF + exit 1 + fi +} + +function zone_check { + if [[ $(zonename) != "global" ]]; then + fatal "these tests must be run from the global zone." + fi +} + +# +# Check that the tests.buildstamp file in the test archive matches +# the current platform stamp. Running tests designed for a platform +# that we're not running is a bad idea. +# +function version_check { + PLATFORM_VERSION=$(uname -v | sed -e 's/^joyent_//g') + mkdir -p /tmp/version_check.$$ + tar xzf $1 -C /tmp/version_check.$$ ./tests.buildstamp + TESTS_VERSION=$(cat /tmp/version_check.$$/tests.buildstamp) + rm -rf /tmp/version_check.$$ + log "Platform version: $PLATFORM_VERSION" + log " Tests version: $TESTS_VERSION" + if [[ "$PLATFORM_VERSION" != "$TESTS_VERSION" ]]; then + fatal "mismatched platform version and tests version!" + fi +} + +function snapshot_rollback_opt { + snapshot="system-test-smartos-test" + has_snapshot=$(zfs list zones/opt@$snapshot 2> /dev/null) + if [[ -n "$has_snapshot" ]]; then + log_must zfs rollback zones/opt@$snapshot + else + log_must zfs snapshot zones/opt@$snapshot + fi +} + +# +# Since some tests want to deliver to /usr which is read-only on SmartOS, +# we make a temporary directory, dump the current /usr there, extract our +# content to it, then lofs-mount it over the real thing. +# +function add_loopback_mounts { + test_archive=$1 + lofs_home=/var/tmp/smartos-test-loopback + + # If /usr is already lofs mounted, and pointing at $lofs_home, just + # extract our new test bits on top. Ideally we'd just unmount it, + # but while running this script, there's a good chance that the dataset + # will be busy and the umount would fail. + FS=$(/bin/df -n /usr | awk '{print $NF'}) + if [[ "$FS" == "lofs" ]]; then + is_test_lofs=$(mount | grep ^/usr | grep "$lofs_home/usr ") + if [[ -z "$is_test_lofs" ]]; then + fatal "unsupported: existing lofs mount for /usr is not $lofs_home" + else + log "Extracting new test archive to lofs-mounted /usr" + # extract the current test archive to it + log_must tar -xzf $test_archive -C $lofs_home ./usr + fi + # Otherwise, setup a lofs mount for it. + else + log "Creating new lofs mount for /usr on $lofs_home" + rm -rf $lofs_home + mkdir -p $lofs_home + find /usr | cpio -pdum $lofs_home + log_must tar -xzf $test_archive -C $lofs_home ./usr + # keep this read-only in an attempt to preserve smartos behaviour + log_must mount -O -F lofs -o ro $lofs_home/usr /usr + fi +} + +# +# Extract the non-/usr parts of the test archive +# +function extract_remaining_test_bits { + log_must tar -xzf $1 -C / \ + ./opt ./kernel ./tests.manifest.gen ./tests.buildstamp +} + +function setup_pkgsrc { + + if [[ -f /opt/tools/etc/pkgin/repositories.conf ]]; then + log "Pkgsrc bootstrap already setup, continuing" + return + fi + + # We should always use the same pkgsrc version as we have installed + # on the build machine in case any of our tests link against libraries + # in /opt/local + PKGSRC_STEM="https://pkgsrc.joyent.com/packages/SmartOS/bootstrap" + BOOTSTRAP_TAR="bootstrap-2018Q4-tools.tar.gz" + BOOTSTRAP_SHA="b599667c80e4a42157763ed25d868ec7dc34962d" + + # Ensure we are in a directory with enough space for the bootstrap + # download, by default the SmartOS /root directory is limited to the size + # of the ramdisk. + cd /var/tmp + + # Download the bootstrap kit to the current directory. Note that we + # currently pass "-k" to skip SSL certificate checks as the GZ doesn't + # install them. + log_must curl -kO ${PKGSRC_STEM}/${BOOTSTRAP_TAR} + + # Verify the SHA1 checksum. + [[ "${BOOTSTRAP_SHA}" = "$(/bin/digest -a sha1 ${BOOTSTRAP_TAR})" ]] || \ + fatal "checksum failure" + + # Install bootstrap kit to /opt/tools + log_must tar -zxpf ${BOOTSTRAP_TAR} -C / + + # add a symlink from /opt/local, needed by many test suites + if [[ ! -d /opt/local && ! -L /opt/local ]]; then + log_must ln -s /opt/tools /opt/local + else + log "Not forging /opt/local link" + fi +} + +function install_required_pkgs { + + log_must pkgin -y in ${SMARTOS_TEST_PKGS} +} + +function add_test_accounts { + + grep -q cyrus: /etc/passwd + if [[ $? -ne 0 ]]; then + log "adding cyrus user" + echo "cyrus:x:977:1::/home/cyrus:/bin/sh" >> /etc/passwd + echo "cyrus:*LK*:::::::" >> /etc/shadow + fi + grep -q ztest: /etc/passwd + if [[ $? -ne 0 ]]; then + log "adding ztest user" + echo "ztest:x:978:1::/home/ztest:/bin/sh" >> /etc/passwd + echo "ztest:*LK*:::::::" >> /etc/shadow + mkdir -p /opt/tools/etc/sudoers.d + echo "ztest ALL=(ALL) NOPASSWD: ALL" >> /opt/tools/etc/sudoers.d/ztest + fi +} + +# +# By using log_test or log_testrunner, we accumulate the exit codes from each +# test run to $RESULT. +# +function execute_tests { + + log "Starting test runs" + log_test bhyvetest /opt/bhyvetest/bin/bhyvetest -ak + log_testrunner crypto-tests /opt/crypto-tests/runfiles/default.run + log_testrunner elf-tests /opt/elf-tests/runfiles/default.run + log_testrunner libc-tests /opt/libc-tests/runfiles/default.run + log_test vndtest /opt/vndtest/bin/vndtest -a + log_testrunner util-tests /opt/util-tests/runfiles/default.run + + if [[ -n "$FAILED_TESTS" ]]; then + echo "" + log "Failures were seen in the following test suites: $FAILED_TESTS" + fi + +} + +function usage { + echo "Usage: smartos-test [-h] [-c] [-e] [-r] <path to tests.tgz>" + echo "" + echo "At least one of -c, -e, -r is required." + echo "" + echo " -h print usage" + echo " -c configure the system for testing" + echo " -e execute known tests" + echo " -f skip the check to ensure platform version == test version" + echo " -r roll back to the zones/opt@system-smartos-test snapshot" + echo " before doing any system configuration or test execution" +} + +skip_version_check=false +do_configure=false +do_execute=false +do_rollback=false + +# +# Main +# +while getopts "cefrh" opt; do + case "${opt}" in + c) + do_configure=true + ;; + e) + do_execute=true + ;; + f) + skip_version_check=true + ;; + r) + do_rollback=true + ;; + h) + usage + exit 2 + ;; + *) + log "unknown argument ${opt}" + usage + exit 2 + esac +done +shift $((OPTIND - 1)) + +test_archive=$1 + +if [[ -z "$test_archive" ]]; then + log "missing test archive argument." + usage + exit 1 +fi + +if [[ ! -f "$test_archive" ]]; then + usage + fatal "unable to access test archive at $test_archive" +fi + +if [[ "$do_rollback" = false && \ + "$do_configure" = false && \ + "$do_execute" = false ]]; then + log "nothing to do: use at least one of -r -e -c" + usage + exit 2 +fi + +if [[ "$skip_version_check" = false ]]; then + version_check $1 +fi + +guard_production_data +zone_check + +if [[ $do_rollback = true ]]; then + snapshot_rollback_opt +fi + +if [[ $do_configure = true ]]; then + add_loopback_mounts $test_archive + extract_remaining_test_bits $test_archive + add_test_accounts + setup_pkgsrc + install_required_pkgs +fi + +if [[ "$do_execute" = true ]]; then + execute_tests +fi + +if [[ $RESULT -gt 0 ]]; then + exit 1 +else + exit 0 +fi diff --git a/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh b/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh index 0df113d490..0f4b77f9c9 100644 --- a/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh +++ b/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh @@ -16,6 +16,8 @@ # XGREP=${XGREP:=/usr/bin/grep} + +MY_TESTS=${MY_TESTS:=/opt/util-tests} FILEDIR=$MY_TESTS/tests/files fail() { |