2046N/A#!/usr/bin/python
2046N/A#
2046N/A# CDDL HEADER START
2046N/A#
2046N/A# The contents of this file are subject to the terms of the
2046N/A# Common Development and Distribution License (the "License").
2046N/A# You may not use this file except in compliance with the License.
2046N/A#
2046N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2046N/A# or http://www.opensolaris.org/os/licensing.
2046N/A# See the License for the specific language governing permissions
2046N/A# and limitations under the License.
2046N/A#
2046N/A# When distributing Covered Code, include this CDDL HEADER in each
2046N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2046N/A# If applicable, add the following below this CDDL HEADER, with the
2046N/A# fields enclosed by brackets "[]" replaced with your own identifying
2046N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2046N/A#
2046N/A# CDDL HEADER END
2046N/A#
2046N/A
3307N/A# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
2046N/A
3339N/Afrom . import testutils
2046N/Aif __name__ == "__main__":
2046N/A testutils.setup_environment("../../../proto")
2046N/Aimport pkg5unittest
2046N/A
2046N/Aimport os.path
2046N/Aimport shutil
2046N/Aimport unittest
2046N/Aimport tempfile
2046N/A
2838N/Aimport pkg.lint.base as base
2046N/Aimport pkg.lint.engine as engine
2046N/Aimport pkg.lint.log as log
2046N/Aimport pkg.fmri as fmri
2046N/Aimport pkg.manifest
2046N/A
2147N/Afrom pkg.lint.engine import lint_fmri_successor
2434N/Afrom pkg.lint.base import linted, DuplicateLintedAttrException
2147N/A
2046N/Aimport logging
3158N/Alog_fmt_string = "{asctime} - {levelname} - {message}"
2046N/A
2046N/Alogger = logging.getLogger("pkglint")
2046N/Aif not logger.handlers:
2046N/A logger.setLevel(logging.WARNING)
2046N/A ch = logging.StreamHandler()
2046N/A formatter = logging.Formatter(log_fmt_string)
2046N/A ch.setFormatter(formatter)
2046N/A ch.setLevel(logging.WARNING)
2046N/A logger.addHandler(ch)
2046N/A
3158N/Apkglintrcfile = "{0}/usr/share/lib/pkg/pkglintrc".format(pkg5unittest.g_pkg_path)
2046N/Abroken_manifests = {}
2046N/Aexpected_failures = {}
2046N/A
2147N/Aexpected_failures["unusual_perms.mf"] = ["pkglint.action002.2",
2147N/A "pkglint.action002.1", "pkglint.action002.4", "pkglint.action002.4",
2477N/A # 5 errors corresponding to the broken group checks above
2477N/A "pkglint.action002.3", "pkglint.action009", "pkglint.action009",
2477N/A "pkglint.action009", "pkglint.action009"]
2147N/Abroken_manifests["unusual_perms.mf"] = \
2046N/A"""
2046N/A#
2046N/A#
2147N/A# We deliver prtdiag as a link on one platform, as a file on another, which is
2147N/A# allowed, testing variant combinations, the unusual permissions are not.
2147N/A# they being, broken mode 991, a mode where we have more access as the group and
2147N/A# world than we have as the user, and an underspecified mode
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Ahardlink path=usr/sbin/prtdiag target=../../usr/lib/platexec variant.arch=sparc
3382N/Afile 1d5eac1aab628317f9c088d21e4afda9c754bb76 chash=43dbb3e0bc142f399b61d171f926e8f91adcffe2 elfarch=i386 elfbits=64 elfhash=64c67b16be970380cd5840dd9753828e0c5ada8c group=sys mode=2755 owner=root path=usr/sbin/prtdiag pkg.csize=5490 pkg.size=13572 variant.arch=i386
2147N/A# invalid modes
2147N/Adir path=usr mode=991
2147N/Adir path=usr/foo mode=457
2147N/Adir path=usr/foo/other mode=222
2477N/Afile NOHASH path=usr/foo/file mode=0112 owner=root group=staff
2477N/Afile NOHASH path=usr/foo/bar mode=01 owner=root group=staff
2046N/A"""
2046N/A
2046N/A# ERROR pkglint.dupaction008 path usr/sbin/prtdiag is delivered by multiple action types
2046N/A# across pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141
2046N/A# ERROR pkglint.dupaction001.2 path usr/sbin/prtdiag is a duplicate delivered by
2046N/A# pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141
2046N/A# declaring overlapping variants variant.arch
2046N/Aexpected_failures["combo_variants_broken.mf"] = ["pkglint.dupaction008",
2597N/A "pkglint.dupaction001.2"]
2046N/Abroken_manifests["combo_variants_broken.mf"] = \
2046N/A"""
2046N/A#
2046N/A#
2597N/A# We deliver prtdiag as a dir on one platform, as a file on another
2597N/A# but have forgotten to set the variant properly on the file action
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2597N/Aset name=pkg.summary value="Core Solaris Kernel"
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Adir path=usr/sbin/prtdiag owner=root group=sys mode=0755 variant.arch=sparc
3382N/Afile 1d5eac1aab628317f9c088d21e4afda9c754bb76 chash=43dbb3e0bc142f399b61d171f926e8f91adcffe2 elfarch=i386 elfbits=64 elfhash=64c67b16be970380cd5840dd9753828e0c5ada8c group=sys mode=2755 owner=root path=usr/sbin/prtdiag pkg.csize=5490 pkg.size=13572 variant.arch=sparc
2597N/A"""
2597N/A
2597N/A
2597N/A
2597N/A#ERROR pkglint.dupaction008 path usr/sbin/prtdiag is delivered by multiple
2597N/A# action types across
2597N/A# pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2597N/A#ERROR pkglint.dupaction010.2 path usr/sbin/prtdiag has missing mediator
2597N/A# attributes across actions in
2597N/A# pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2597N/A#ERROR pkglint.dupaction010.1 path usr/sbin/prtdiag uses multiple action
2597N/A# types for potentially mediated links across
2597N/A# actions in pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2597N/A#ERROR pkglint.dupaction001.2 path usr/sbin/prtdiag is a duplicate delivered
2597N/A# by pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2597N/A# declaring overlapping variants variant.arch=sparc
2597N/A
2597N/Aexpected_failures["combo_variants_broken_links.mf"] = ["pkglint.dupaction008",
2597N/A "pkglint.dupaction001.2", "pkglint.dupaction010.1"]
2597N/Abroken_manifests["combo_variants_broken_links.mf"] = \
2597N/A"""
2597N/A#
2597N/A#
2046N/A# We deliver prtdiag as a link on one platform, as a file on another
2597N/A# but have forgotten to set the variant properly on the file action.
2597N/A# The errors are similar to combo_variants_broken, but becase the user has
2597N/A# included links, we don't know whether they intended to use mediated links
2597N/A# or not, so we report additional errors.
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Ahardlink path=usr/sbin/prtdiag target=../../usr/lib/platexec variant.arch=sparc
3382N/Afile 1d5eac1aab628317f9c088d21e4afda9c754bb76 chash=43dbb3e0bc142f399b61d171f926e8f91adcffe2 elfarch=i386 elfbits=64 elfhash=64c67b16be970380cd5840dd9753828e0c5ada8c group=sys mode=2755 owner=root path=usr/sbin/prtdiag pkg.csize=5490 pkg.size=13572 variant.arch=sparc
2046N/A"""
2046N/A
2091N/Aexpected_failures["dup-clashing-vars.mf"] = ["pkglint.dupaction001.1"]
2046N/Abroken_manifests["dup-clashing-vars.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we try to deliver usr/sbin/fsadmin twice with the same variant value
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.other value=carrots
2046N/Aset name=variant.arch value=i386 value=sparc
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=953 pkg.size=1572 variant.other=carrots
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234 variant.other=carrots
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2081N/Aexpected_failures["dup-depend-vars.mf"] = ["pkglint.manifest005.2",
2081N/A "pkglint.action005.1", "pkglint.action005.1",
2081N/A "pkglint.action005.1"]
2046N/Abroken_manifests["dup-depend-vars.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we declare dependencies on the same package name twice, with variants
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWzsh@4.3.9,5.11-0.133:20100216T103302Z
2046N/Aset name=org.opensolaris.consolidation value=sfw
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.arch value=sparc value=i386
2046N/Aset name=variant.foo value=bar value=baz
2046N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require variant.foo=bar
2046N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
2046N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require variant.foo=bar
2046N/Adepend fmri=shell/zsh/redherring@4.3.9-0.133 type=require variant.foo=bar
2046N/A"""
2046N/A
2081N/Aexpected_failures["dup-depend-incorp.mf"] = ["pkglint.action005.1"]
2046N/Abroken_manifests["dup-depend-incorp.mf"] = \
2046N/A"""
2046N/A#
2046N/A# There are 2 dependencies on sfw-incorporation, but only one is a require
2081N/A# incorporation, so this should not generate errors, other than us not being
2081N/A# able to find the dependency warning.
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/entire@0.5.11,5.11-0.145:20100730T013044Z
2046N/Aset name=pkg.depend.install-hold value=core-os
2046N/Aset name=pkg.description value="This package constrains system package versions to the same build. WARNING: Proper system update and correct package selection depend on the presence of this incorporation. Removing this package will result in an unsupported system."
2046N/Aset name=description value="incorporation to lock all system packages to same build"
2046N/Aset name=pkg.summary value="incorporation to lock all system packages to same build"
2046N/Aset name=variant.arch value=sparc value=i386
2046N/Aset name=org.opensolaris.consolidation value=None
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
2046N/Adepend fmri=consolidation/sfw/sfw-incorporation@0.5.11-0.145 type=incorporate
2046N/A"""
2046N/A
2081N/Aexpected_failures["dup-depend-versions.mf"] = ["pkglint.action005.1",
2081N/A "pkglint.action005.1", "pkglint.action005.1"]
2046N/Abroken_manifests["dup-depend-versions.mf"] = \
2046N/A"""
2046N/A#
2081N/A# as we're declaring complimentary variants, we shouldn't report errors,
2081N/A# other than the 3 lint warnings for the missing dependencies
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWzsh@4.3.9,5.11-0.133:20100216T103302Z
2046N/Aset name=org.opensolaris.consolidation value=sfw
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2046N/Aset name=variant.arch value=sparc value=i386
2046N/Aset name=variant.other value=other value=thing
2046N/Aset name=variant.foo value=bar value=baz
2046N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require variant.foo=bar
2046N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
2046N/Adepend fmri=shell/zsh@4.3.9-0.134 type=require variant.foo=baz
2046N/A"""
2046N/A
2434N/Aexpected_failures["dup-depend-linted.mf"] = ["pkglint.action005.1",
2434N/A "pkglint.action008"]
2434N/Abroken_manifests["dup-depend-linted.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We deliver duplicate dependencies, one coming from a require-any dep
2434N/A#
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Adepend fmri=foo/bar type=require pkg.linted.pkglint.manifest005.2=True
2434N/Adepend fmri=foo/bar fmri=foo/baz type=require-any
2434N/A"""
2434N/A
3467N/Aexpected_failures["dup-depend-require-any_1.mf"] = ["pkglint.manifest005.2",
2434N/A "pkglint.action005.1"]
3467N/Abroken_manifests["dup-depend-require-any_1.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We deliver duplicate dependencies, one coming from a require-any dep
2434N/A#
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Adepend fmri=foo/bar type=require
2434N/Adepend fmri=foo/bar fmri=foo/baz type=require-any
2434N/A"""
2434N/A
3467N/Aexpected_failures["dup-depend-require-any_2.mf"] = ["pkglint.manifest005.2"]
3467N/Abroken_manifests["dup-depend-require-any_2.mf"] = \
3467N/A"""
3467N/A#
3467N/A# Should use all values of fmri attribute for duplicate depends check
3467N/A#
3467N/Aset name=variant.arch value=i386 value=sparc
3467N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
3467N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
3467N/Aset name=org.opensolaris.consolidation value=osnet
3467N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
3467N/Aset name=pkg.summary value="Core Solaris Kernel"
3467N/Adepend fmri=foo/gcc-c++-runtime fmri=foo/gcc-3-runtime type=require-any
3467N/Adepend fmri=foo/gcc-c++-runtime fmri=foo/gcc-3-runtime type=require-any
3467N/A"""
3467N/A
3467N/Aexpected_failures["dup-depend-group-any_1.mf"] = []
3467N/Abroken_manifests["dup-depend-group-any_1.mf"] = \
3467N/A"""
3467N/A#
3467N/A# Should use all values of fmri attribute for duplicate depends check
3467N/A#
3467N/Aset name=variant.arch value=i386 value=sparc
3467N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
3467N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
3467N/Aset name=org.opensolaris.consolidation value=osnet
3467N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
3467N/Aset name=pkg.summary value="Core Solaris Kernel"
3467N/Adepend fmri=foo/gcc-c++-runtime fmri=foo/gcc-3-runtime type=group-any
3467N/Adepend fmri=foo/gcc-c-runtime fmri=foo/gcc-3-runtime type=group-any
3467N/A"""
3467N/A
3467N/Aexpected_failures["dup-depend-group-any_2.mf"] = ["pkglint.manifest005.2"]
3467N/Abroken_manifests["dup-depend-group-any_2.mf"] = \
3467N/A"""
3467N/A#
3467N/A# Should use all values of fmri attribute for duplicate depends check
3467N/A#
3467N/Aset name=variant.arch value=i386 value=sparc
3467N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
3467N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
3467N/Aset name=org.opensolaris.consolidation value=osnet
3467N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
3467N/Aset name=pkg.summary value="Core Solaris Kernel"
3467N/Adepend fmri=foo/gcc-c++-runtime fmri=foo/gcc-3-runtime type=group-any
3467N/Adepend fmri=foo/gcc-c++-runtime fmri=foo/gcc-3-runtime type=group-any
3467N/A"""
3467N/A
3467N/Aexpected_failures["dup-depend-group-any_require-any_1.mf"] = ["pkglint.manifest005.2"]
3467N/Abroken_manifests["dup-depend-group-any_require-any_1.mf"] = \
3467N/A"""
3467N/A#
3467N/A# Should use all values of fmri attribute for duplicate depends check
3467N/A#
3467N/Aset name=variant.arch value=i386 value=sparc
3467N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
3467N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
3467N/Aset name=org.opensolaris.consolidation value=osnet
3467N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
3467N/Aset name=pkg.summary value="Core Solaris Kernel"
3467N/Adepend fmri=foo/gcc-c-runtime fmri=foo/gcc-3-runtime type=require-any
3467N/Adepend fmri=foo/gcc-c-runtime fmri=foo/gcc-3-runtime type=group-any
3467N/A"""
3467N/A
3467N/Aexpected_failures["dup-depend-group-any_require-any_2.mf"] = []
3467N/Abroken_manifests["dup-depend-group-any_require-any_2.mf"] = \
3467N/A"""
3467N/A#
3467N/A# Should use all values of fmri attribute for duplicate depends check
3467N/A#
3467N/Aset name=variant.arch value=i386 value=sparc
3467N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
3467N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
3467N/Aset name=org.opensolaris.consolidation value=osnet
3467N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
3467N/Aset name=pkg.summary value="Core Solaris Kernel"
3467N/Adepend fmri=foo/gcc-c-runtime fmri=foo/gcc-3-runtime type=require-any
3467N/Adepend fmri=foo/gcc-c++-runtime fmri=foo/gcc-3-runtime type=group-any
3467N/A"""
3467N/A
3467N/Aexpected_failures["bug-17337432.mf"] = []
3467N/Abroken_manifests["bug-17337432.mf"] = \
3467N/A"""
3467N/A#
3467N/A# Should use all values of fmri attribute for duplicate depends check
3467N/A#
3467N/Aset name=variant.arch value=i386 value=sparc
3467N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
3467N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
3467N/Aset name=org.opensolaris.consolidation value=osnet
3467N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
3467N/Aset name=pkg.summary value="Core Solaris Kernel"
3467N/Adepend fmri=foo/gcc-c++-runtime fmri=foo/gcc-3-runtime type=require-any
3467N/Adepend fmri=foo/gcc-c-runtime fmri=foo/gcc-3-runtime type=require-any
3467N/A"""
3467N/A
2434N/Aexpected_failures["license-has-path.mf"] = ["pkglint.action007"]
2434N/Abroken_manifests["license-has-path.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We deliver a license action that also specifies a path
2434N/A#
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Alicense license="Foo" path=usr/share/lib/legalese.txt
2434N/A"""
2434N/A
2046N/Aexpected_failures["dup-no-vars.mf"] = ["pkglint.dupaction001.1"]
2046N/Abroken_manifests["dup-no-vars.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We try to deliver usr/sbin/fsadmin twice without specifying any variants
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.arch value=i386 value=sparc
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=953 pkg.size=1572
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2046N/Aexpected_failures["dup-refcount-diff-attrs.mf"] = ["pkglint.dupaction007"]
2046N/Abroken_manifests["dup-refcount-diff-attrs.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we deliver some duplicate ref-counted actions (dir, link, hardlink) with differing
2046N/A# attributes
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.other value=carrots
2046N/Aset name=variant.arch value=i386 value=sparc
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Adir group=sys mode=0755 owner=root path=/usr/lib/X11
2046N/A"""
2046N/A
2597N/Aexpected_failures["dup-refcount-diff-types.mf"] = ["pkglint.dupaction008",
2597N/A "pkglint.dupaction010.1"]
2597N/Abroken_manifests["dup-refcount-diff-types.mf"] = \
2597N/A"""
2597N/A#
2597N/A# we deliver some duplicate ref-counted actions (dir, link, hardlink) with differing
2597N/A# types
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=variant.other value=carrots
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=pkg.description value="Description of pkglint test package"
2597N/Aset name=description value="Pkglint test package"
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Aset name=pkg.summary value="Pkglint test package"
2597N/Alink path=usr/bin/gcc target=foo/gcc-bin1
2597N/Ahardlink path=usr/bin/gcc target=bar/gcc-bin1
2597N/A"""
2597N/A
2597N/Aexpected_failures["dup-refcount-legacy.mf"] = ["pkglint.dupaction007"]
2597N/Abroken_manifests["dup-refcount-legacy.mf"] = \
2597N/A"""
2597N/A#
2597N/A# we deliver two legacy actions with mismatched attributes
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=variant.other value=carrots
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=pkg.description value="Description of pkglint test package"
2597N/Aset name=description value="Pkglint test package"
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Aset name=pkg.summary value="Pkglint test package"
2597N/Alegacy category=system desc="The Apache HTTP Server Version (usr components)" \
2597N/A hotline="Please contact your local service provider" \
2597N/A name="Apache Web Server (usr)" pkg=SUNWapch22u vendor="Oracle Corporation" \
2597N/A version=11.11.0,REV=2010.05.25.01.00
2597N/Alegacy category=system desc="The Apache HTTP Server (usr components)" \
2597N/A hotline="Please contact your local service provider" \
2597N/A name="Apache Web Server (usr)" pkg=SUNWapch22u vendor="Oracle Corporation" \
2597N/A version=11.11.0,REV=2010.05.25.01.00
2597N/A"""
2597N/A
2046N/A# 3 errors get reported for this manifest:
2046N/A# usr/sbin/fsadmin is delivered by multiple action types across ['pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z']
2046N/A# usr/sbin/fsadmin delivered by [<pkg.fmri.PkgFmri 'pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z' at 0x8733e2c>] is a duplicate, declaring overlapping variants ['variant.other']
2046N/Aexpected_failures["dup-types-clashing-vars.mf"] = ["pkglint.dupaction008",
2597N/A "pkglint.dupaction001.1"]
2046N/Abroken_manifests["dup-types-clashing-vars.mf"] = \
2046N/A"""
2046N/A#
2091N/A# we try to deliver usr/sbin/fsadmin with different action types, declaring a
2091N/A# variant on both.
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=variant.other value=carrots
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Adir group=bin mode=0755 owner=root path=usr/sbin/fsadmin variant.other=carrots
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234 variant.other=carrots
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2046N/Aexpected_failures["dup-types.mf"] = ["pkglint.dupaction008",
2597N/A "pkglint.dupaction010.1"]
2046N/Abroken_manifests["dup-types.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we deliver usr/lib/X11/fs as several action types
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.arch value=i386 value=sparc
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Alink group=bin mode=0755 alt=foo owner=foor path=usr/lib/X11/fs target=bar
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2046N/Aexpected_failures["duplicate_sets.mf"] = ["pkglint.manifest006"]
2046N/Abroken_manifests["duplicate_sets.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We try to deliver the same set action twice
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=test value=i386
2046N/Aset name=test value=i386
2046N/A"""
2046N/A
2046N/Aexpected_failures["duplicate_sets_allowed_vars.mf"] = []
2046N/Abroken_manifests["duplicate_sets_allowed_vars.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We try to deliver the same set action twice, with different variants
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=test value=i386 variant.arch=sparc
2046N/Aset name=test value=i386 variant.arch=i386
2046N/A"""
2046N/A
2046N/Aexpected_failures["duplicate_sets_variants.mf"] = ["pkglint.manifest006"]
2046N/Abroken_manifests["duplicate_sets_variants.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We try to deliver the same set action twice, with variants
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=test value=i386 variant.arch=sparc
2046N/Aset name=test value=i386 variant.arch=sparc
2046N/A"""
2046N/A
2434N/Aexpected_failures["duplicate_sets-linted.mf"] = ["pkglint.manifest006",
2434N/A "pkglint.action008"]
2434N/Abroken_manifests["duplicate_sets-linted.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We try to deliver the same set action twice, the second time we do this,
2434N/A# we mark one of the actions as linted
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=test value=i386
2434N/Aset name=test value=i386
2434N/Aset name=foo value=bar pkg.linted.pkglint.manifest006=True
2434N/Aset name=foo value=bar
2434N/A"""
2434N/A
2434N/A
2434N/Aexpected_failures["duplicate_sets-not-enough-lint.mf"] = ["pkglint.manifest006",
2434N/A "pkglint.action008"]
2434N/Abroken_manifests["duplicate_sets-not-enough-lint.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We try to deliver the same set action twice, the second time we do this,
2434N/A# we mark one of the actions as linted, but still should have a broken manifest
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=test value=i386
2434N/Aset name=foo value=bar pkg.linted.pkglint.manifest006=True
2434N/Aset name=foo value=bar
2434N/Aset name=foo value=bar
2434N/A"""
2434N/A
2085N/Aexpected_failures["info_class_valid.mf"] = []
2085N/Abroken_manifests["info_class_valid.mf"] = \
2085N/A"""
2085N/A#
2085N/A# A perfectly valid manifest with a correct info.classification key
2085N/A#
2085N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2085N/Aset name=org.opensolaris.consolidation value=osnet
2085N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2085N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2085N/Aset name=description value="Pkglint test package"
2085N/Aset name=pkg.summary value="Pkglint test package"
2085N/Aset name=variant.arch value=i386 value=sparc
2085N/A"""
2085N/A
2085N/Aexpected_failures["info_class_missing.mf"] = ["opensolaris.manifest001.1"]
2085N/Abroken_manifests["info_class_missing.mf"] = \
2085N/A"""
2085N/A#
2085N/A# we deliver package with no info.classification key
2085N/A#
2085N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2085N/Aset name=org.opensolaris.consolidation value=osnet
2085N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2213N/Aset name=description value="Pkglint test package"
2213N/Aset name=pkg.summary value="Pkglint test package"
2213N/Aset name=variant.arch value=i386 value=sparc
2213N/A"""
2213N/A
2731N/Aexpected_failures["silly_description.mf"] = ["pkglint.manifest009.2"]
2213N/Abroken_manifests["silly_description.mf"] = \
2213N/A"""
2213N/A#
2213N/A# we deliver package where the description is the same as the summary
2213N/A#
2213N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2213N/Aset name=org.opensolaris.consolidation value=osnet
2213N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2085N/Aset name=pkg.description value="Pkglint test package"
2213N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2085N/Aset name=pkg.summary value="Pkglint test package"
2085N/Aset name=variant.arch value=i386 value=sparc
2085N/A"""
2085N/A
2731N/Aexpected_failures["empty_description.mf"] = ["pkglint.manifest009.1"]
2731N/Abroken_manifests["empty_description.mf"] = \
2731N/A"""
2731N/A#
2731N/A# we deliver package where the description is empty
2731N/A#
2731N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2731N/Aset name=org.opensolaris.consolidation value=osnet
2731N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2731N/Aset name=pkg.description value=""
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2731N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=variant.arch value=i386 value=sparc
2731N/A"""
2731N/A
2731N/Aexpected_failures["empty_summary.mf"] = ["pkglint.manifest009.3"]
2731N/Abroken_manifests["empty_summary.mf"] = \
2731N/A"""
2731N/A#
2731N/A# we deliver package where the summary is empty
2731N/A#
2731N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2731N/Aset name=org.opensolaris.consolidation value=osnet
2731N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2731N/Aset name=pkg.description value="Pkglint test package"
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2731N/Aset name=pkg.summary value=""
2731N/Aset name=variant.arch value=i386 value=sparc
2731N/A"""
2731N/A
2731N/Aexpected_failures["info_class_many_values.mf"] = ["pkglint.manifest008.6"]
2085N/Abroken_manifests["info_class_many_values.mf"] = \
2085N/A"""
2085N/A#
2085N/A# we deliver a directory with multiple info.classification keys, one of which
2085N/A# is wrong
2085N/A#
2085N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2085N/Aset name=org.opensolaris.consolidation value=osnet
2085N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2085N/Aset name=description value="Pkglint test package"
2085N/Aset name=info.classification value=org.opensolaris.category.2008:System/Noodles value=org.opensolaris.category.2008:System/Core
2085N/Aset name=pkg.summary value="Pkglint test package"
2085N/Aset name=variant.arch value=i386 value=sparc
2085N/A"""
2085N/A
2731N/Aexpected_failures["info_class_wrong_prefix.mf"] = ["pkglint.manifest008.2"]
2085N/Abroken_manifests["info_class_wrong_prefix.mf"] = \
2085N/A"""
2085N/A#
2085N/A# we deliver a directory with an incorrect info.classification key
2085N/A#
2085N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2085N/Aset name=org.opensolaris.consolidation value=osnet
2085N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2085N/Aset name=description value="Pkglint test package"
2085N/Aset name=info.classification value=org.opensolaris.category.2010:System/Core
2085N/Aset name=pkg.summary value="Pkglint test package"
2085N/Aset name=variant.arch value=i386 value=sparc
2085N/A"""
2085N/A
2731N/Aexpected_failures["info_class_no_category.mf"] = ["pkglint.manifest008.3"]
2085N/Abroken_manifests["info_class_no_category.mf"] = \
2085N/A"""
2085N/A#
2085N/A# we deliver a directory with an incorrect info.classification key,
2085N/A# with no category value
2085N/A#
2085N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2085N/Aset name=org.opensolaris.consolidation value=osnet
2085N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2085N/Aset name=description value="Pkglint test package"
2085N/Aset name=info.classification value=org.opensolaris.category.2008:
2085N/Aset name=pkg.summary value="Pkglint test package"
2085N/Aset name=variant.arch value=i386 value=sparc
2085N/A"""
2085N/A
2731N/Aexpected_failures["info_class_wrong_category.mf"] = ["pkglint.manifest008.4"]
2085N/Abroken_manifests["info_class_wrong_category.mf"] = \
2085N/A"""
2085N/A#
2085N/A# we deliver a directory with incorrect info.classification section/category
2085N/A#
2085N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.149:20100917T003411Z
2085N/Aset name=org.opensolaris.consolidation value=osnet
2085N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2085N/Aset name=description value="Pkglint test package"
2085N/Aset name=info.classification value=org.opensolaris.category.2008:Rubbish/Packaging
2085N/Aset name=pkg.summary value="Pkglint test package"
2085N/Aset name=variant.arch value=i386 value=sparc
2085N/A"""
2085N/A
2434N/Aexpected_failures["invalid_fmri.mf"] = ["pkglint.action006",
2481N/A "pkglint.action006", "pkglint.action009", "pkglint.action009"]
2434N/Abroken_manifests["invalid_fmri.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We deliver some broken fmri values
2434N/A#
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Adepend fmri=foo/bar@@134 type=require
2434N/Adepend fmri=foo/bar fmri="" type=require-any
2434N/A"""
2434N/A
2434N/Aexpected_failures["invalid_linted.mf"] = ["pkglint.action006",
2481N/A "pkglint.action006", "pkglint001.6", "pkglint001.6", "pkglint.manifest007",
2481N/A "pkglint.action009", "pkglint.action009"]
2434N/Abroken_manifests["invalid_linted.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We have a broken pkg.linted action, so we report both broken depend actions
2434N/A# due to the corrupt FMRI values. We also report two failed attempts
2434N/A# to use the pkg.linted.pkglint.action006 value, as well as the existence of a
2434N/A# pkg.linted value.
2434N/A#
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Aset name=pkg.linted.pkglint.action006 value=True value=False
2434N/Adepend fmri=foo/bar@@134 type=require
2434N/Adepend fmri=foo/bar fmri="" type=require-any
2434N/A"""
2434N/A
3254N/Aexpected_failures["invalid_usernames.mf"] = ["pkglint.action010.4",
3254N/A "pkglint.action010.2", "pkglint.action010.3", "pkglint.action010.1",
2731N/A "pkglint.action010.3"]
2046N/Abroken_manifests["invalid_usernames.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We try to deliver a series of invalid usernames, some result in multiple
2046N/A# lint messages
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=variant.arch value=i386 value=sparc
3356N/Auser gcos-field="pkg(7) server UID" group=pkg5srv uid=97 username=""
3356N/Auser gcos-field="pkg(7) server UID" group=pkg5srv uid=98 username=1pkg5srv
3356N/Auser gcos-field="pkg(7) server UID" group=pkg5srv uid=99 username=pkg5srv_giant_pacific_octopus_arm
3356N/Auser gcos-field="pkg(7) server UID" group=pkg5srv uid=100 username=pkg5s:v
3356N/Auser gcos-field="pkg(7) server UID" group=pkg5srv uid=101 username=pkg5-_.
2046N/A"""
2046N/A
2147N/Aexpected_failures["license-has-path.mf"] = ["pkglint.action007"]
2046N/Abroken_manifests["license-has-path.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We deliver a license action that also specifies a path
2046N/A#
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Alicense license="Foo" path=usr/share/lib/legalese.txt
2046N/A"""
2046N/A
2434N/A# We actually emit 10 messages here in testing, 3 for the legitmate errors,
2434N/A# 5 saying that we've found pkg.linted attributes in these actions, and 2
2434N/A# for the errors that would be thrown were they not marked as linted.
2046N/A#
2434N/Aexpected_failures["linted-action.mf"] = ["pkglint.action001.2",
2434N/A "pkglint.dupaction003.1", "pkglint.dupaction007",
2434N/A "pkglint.action008", "pkglint.action008", "pkglint.action008",
2434N/A "pkglint.action008", "pkglint.action008", "pkglint001.5", "pkglint001.5"]
2046N/Abroken_manifests["linted-action.mf"] = \
2046N/A"""
2046N/A#
2434N/A# we deliver some duplicate ref-counted actions (dir, link, hardlink) with
2434N/A# differing attributes, but since they're marked as linted, we should get no
2434N/A# output, we should still get the duplicate user though.
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.other value=carrots
2046N/Aset name=variant.arch value=i386 value=sparc
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2434N/A
2434N/A# underscores in the name and another attr, but only bypassing the name check
2434N/Aset name=here_be_underscores value=nothing underscore_attr=Foo pkg.linted.pkglint.action001.1=True
2434N/A
2434N/A# completely linting these actions. No errors for the first, because
2434N/A# the other duplicate paths are linted. The second will result in us logging
2434N/A# a message saying we're ignoring the strange mode.
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11 pkg.linted=True
2434N/Adir group=bin mode=0155 alt=foo owner=root path=usr/lib/X11/fs pkg.linted=True
2434N/A
2434N/A# only linting this action against a specific dupaction check
2434N/Adir group=staff mode=0751 owner=root path=/usr/lib/X11 pkg.linted.pkglint.dupaction007=True
2434N/A
2434N/A# only linting this action against the dupaction group
2434N/Adir group=staff mode=0751 owner=root path=/usr/lib/X11 pkg.linted.pkglint.dupaction=True
2434N/A
2434N/A# we should still report this error:
2434N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2434N/Adir group=bin mode=0755 alt=bar owner=root path=usr/lib/X11/fs
2434N/A
2046N/Auser ftpuser=false gcos-field="Network Configuration Admin" group=netadm uid=17 username=netcfg
2046N/Auser ftpuser=false gcos-field="Network Configuration Admin" group=netadm uid=19 username=netcfg
2046N/A"""
2046N/A
2434N/A# We'll actually report two lint messages here, the existence of the
2434N/A# pkg.linted attribute in the manifest, and the message bypassing
2434N/A# the duplicate user action error.
2046N/A# - the default log handler used by the pkglint CLI only marks
2046N/A# a failure if it's > level.INFO, but for testing, we record all
2046N/A# messages
2434N/Aexpected_failures["linted-manifest.mf"] = ["pkglint001.5",
2434N/A "pkglint.manifest007"]
2046N/Abroken_manifests["linted-manifest.mf"] = \
2046N/A"""
2046N/A#
2046N/A# This manifest is marked as pkg.linted, and should not have manifest
2046N/A# checks run on it. In particular, we should not complain about the lack
2046N/A# of variant.arch nor the unusual permission, 0751
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.other value=carrots
2046N/A# set name=variant.arch value=i386 value=sparc
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2046N/Aset name=pkg.linted value=True
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Adir group=staff mode=0751 owner=root path=/usr/lib/X11
2046N/Auser ftpuser=false gcos-field="Network Configuration Admin" group=netadm uid=17 username=netcfg
2046N/Auser ftpuser=false gcos-field="Network Configuration Admin" group=netadm uid=19 username=netcfg
2046N/A"""
2046N/A
2434N/Aexpected_failures["linted-manifest-check.mf"] = ["pkglint001.5",
2434N/A "pkglint.manifest007", "pkglint.action008"]
2434N/Abroken_manifests["linted-manifest-check.mf"] = \
2434N/A"""
2434N/A#
2434N/A# This manifest is delivers a weird info.classification value
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/Aset name=variant.other value=carrots
2434N/A# set name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.description value="Description of pkglint test package"
2434N/Aset name=description value="Pkglint test package"
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Noodles pkg.linted.pkglint.manifest008.6=True
2434N/Aset name=pkg.summary value="Pkglint test package"
2434N/Aset name=pkg.linted value=True
2434N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2434N/A"""
2434N/A
2434N/Aexpected_failures["linted-manifest-check2.mf"] = ["pkglint001.5",
2434N/A "pkglint001.5", "pkglint001.5", "pkglint.manifest007", "pkglint.action008"]
2434N/Abroken_manifests["linted-manifest-check2.mf"] = \
2434N/A"""
2434N/A#
2434N/A# This manifest delivers actions with underscores in attribute names
2434N/A# and values, but they're all marked linted because we have a manifest-level
2434N/A# pkg.linted key that covers just that check. This produces info messages
2434N/A# for each action that we're not running the pkglint.action001 check on.
2434N/A
2434N/A# So we report 3 linted actions INFO messages, and INFO messages about the
2434N/A# presence of pkg.linted attributes in one action and the manifest.
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/A# an underscore in they key "under_score", linted
2434N/Aset name=variant.other value=carrots under_score=oh_yes
2434N/A# set name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.linted.pkglint.action001 value=True
2434N/Aset name=pkg.description value="Description of pkglint test package"
2434N/Aset name=description value="Pkglint test package"
2434N/A# this is linted due to our our action attribute
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Noodles pkg.linted.pkglint.manifest008.6=True
2434N/A# an underscore the key "foo_name"
2434N/Aset name=pkg.summary value="Pkglint test package" foo_name=bar
2434N/A# this action is ok, underscores in attribute values are fine
2434N/Adir group=bin mode=0755 owner=root path=usr/lib/X11 bar=has_underscore
2434N/A"""
2434N/A
2434N/Aexpected_failures["linted-manifest-check3.mf"] = ["pkglint.action008",
2434N/A "pkglint.manifest007", "pkglint.action001.1", "pkglint.action001.1",
2434N/A "pkglint001.5", "pkglint001.5"]
2434N/Abroken_manifests["linted-manifest-check3.mf"] = \
2434N/A"""
2434N/A#
2434N/A# This manifest delivers lots of actions with underscores in attribute names
2434N/A# and values, but we have a manifest-level check that bypasses only one
2434N/A# of the checks within that method. We should still catch the errors for
2434N/A# underscores in 'set' action 'name' values, but not in other attribute names
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/Aset name=variant.other value=carrots under_score=oh_yes
2434N/A# set name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.linted.pkglint.action001.2 value=True
2434N/Aset name=pkg.description value="Description of pkglint test package"
2434N/Aset name=description value="Pkglint test package"
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Noodles pkg.linted.pkglint.manifest008.6=True
2434N/Aset name=pkg.summary value="Pkglint test package" foo_name=bar
2434N/Aset name=foo_bar value=baz
2434N/Adir group=bin mode=0755 owner=root path=usr/lib/X11 bar=has_underscore
2434N/A"""
2434N/A
2434N/Aexpected_failures["linted-missing-summary.mf"] = ["pkglint001.5",
2434N/A "pkglint.manifest007"]
2434N/Abroken_manifests["linted-missing-summary.mf"] = \
2434N/A"""
2434N/A# We don't care we don't have a summary
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2731N/Aset name=pkg.linted.pkglint.manifest010.2 value=True
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.description value="Description of pkglint test package"
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2434N/A"""
2434N/A
2434N/Aexpected_failures["linted-desc-match-summary.mf"] = ["pkglint001.5", "pkglint.action008"]
2434N/Abroken_manifests["linted-desc-match-summary.mf"] = \
2434N/A"""
2434N/A# We don't care that the description matches the summary
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.description value="Description of pkglint test package"
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2731N/Aset name=pkg.summary value="Description of pkglint test package" pkg.linted.pkglint.manifest009.2=True
2434N/A"""
2434N/A
2434N/Aexpected_failures["linted-dup-path-types.mf"] = ["pkglint.dupaction001.1",
2434N/A "pkglint.action008", "pkglint.manifest007"]
2434N/Abroken_manifests["linted-dup-path-types.mf"] = \
2434N/A"""
2434N/A# We don't care that usr/bin/ls is a different type across two actions, but
2434N/A# make sure we still complain about the duplicate path attribute
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/Aset name=variant.arch value=i386 value=sparc
2731N/Aset name=pkg.linted.pkglint.manifest010.2 value=True
2434N/Aset name=pkg.summary value="Summary of pkglint test package"
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2434N/Afile path=usr/bin/ls owner=root group=staff mode=755 pkg.linted.pkglint.dupaction008=True
2434N/Adir path=usr/bin/ls owner=root group=staff mode=755
2434N/A"""
2434N/A
2434N/A# three messages: saying we're linting the duplicate attribute path, that we've
2434N/A# got a manifest with linted attributes, and an action with a linted attribute.
2434N/Aexpected_failures["linted-dup-attrs.mf"] = ["pkglint001.5", "pkglint.action008",
2434N/A "pkglint.manifest007"]
2434N/Abroken_manifests["linted-dup-attrs.mf"] = \
2434N/A"""
2597N/A# We don't care that usr/bin/ls is a duplicate path
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/Aset name=variant.arch value=i386 value=sparc
2731N/Aset name=pkg.linted.pkglint.manifest010.2 value=True
2434N/Aset name=pkg.summary value="Summary of pkglint test package"
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2434N/Afile path=usr/bin/ls owner=root group=staff mode=755 pkg.linted.pkglint.dupaction001.1=True
2434N/Afile path=usr/bin/ls owner=root group=staff mode=755
2434N/A"""
2434N/A
2597N/Aexpected_failures["linted-dup-refcount.mf"] = ["pkglint.action008",
2597N/A "pkglint.action008"]
2597N/Abroken_manifests["linted-dup-refcount.mf"] = \
2597N/A"""
2597N/A# We don't care that usr/bin/ls are duplicate links, the only output here
2597N/A# should be pkglint.action008, reporting on the use of each linted action.
2597N/A# Despite avoiding pkglint(1) errors here, pkg(1) will still refuse to
2597N/A# install this manifest due to the duplicate links. Don't say we didn't warn you
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/TIMFtest@1.1.0,5.11-0.141:20100604T143737Z
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=pkg.summary value="Summary of pkglint test package"
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Alink path=usr/bin/ls target=baz pkg.linted.pkglint.dupaction010.2=true
2597N/Alink path=usr/bin/ls target=bar
2597N/Alink path=usr/bin/ls target=foo pkg.linted.pkglint.dupaction010.2=true
2597N/A"""
2597N/A
2046N/Aexpected_failures["no_desc-legacy.mf"] = ["pkglint.action003.1"]
2046N/Abroken_manifests["no_desc-legacy.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We deliver a legacy actions without a required attribute, "desc". Since we
2046N/A# can't find the package pointed to by the legacy 'pkg' attribute, we should
2046N/A# not complain about those.
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2597N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Alegacy variant.arch=i386 arch=i386 category=system hotline="Please contact your local service provider" name="Core Solaris Kernel (Root)" pkg=SUNWckr vendor="Sun Microsystems, Inc." version=11.11,REV=2009.11.11
2597N/Alegacy variant.arch=sparc arch=sparc category=system desc="core kernel software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris Kernel (Root)" pkg=SUNWckr vendor="Sun Microsystems, Inc." version=11.11,REV=2009.11.11
2046N/A"""
2046N/A
2046N/Aexpected_failures["no_dup-allowed-vars.mf"] = []
2046N/Abroken_manifests["no_dup-allowed-vars.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we try to deliver usr/sbin/fsadmin twice with the same variant value
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=variant.other value="carrots" value="turnips"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=953 pkg.size=1572 variant.other=carrots
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234 variant.other=turnips
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2046N/Aexpected_failures["no_dup-types-different-vars.mf"] = []
2046N/Abroken_manifests["no_dup-types-different-vars.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we declare allowed variants for usr/lib/X11/fs, despite them
2046N/A# delivering to the same path name. Ref-counted actions, but
2046N/A# different variants, this should not be reported as an error
2046N/A# We also check that the 'target' difference in the link /usr/lib/foo
2046N/A# doesn't result in lint errors.
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=variant.bar value=other value=foo
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Alink path=usr/lib/foo target=usr/sparc-sun-solaris2.11/lib/foo variant.arch=sparc
2046N/Alink path=usr/lib/foo target=usr/i386-pc-solaris2.11/lib/foo variant.arch=i386
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs variant.bar=other
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs variant.bar=foo
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2081N/A# our obsolete depend lint check should complain about not being able to find
2081N/A# manifests, but we shouldn't trigger the duplicate dependency error
2081N/Aexpected_failures["nodup-depend-okvars.mf"] = ["pkglint.action005.1",
2081N/A "pkglint.action005.1", "pkglint.action005.1"]
2046N/Abroken_manifests["nodup-depend-okvars.mf"] = \
2046N/A"""
2046N/A#
2046N/A# as we're declaring complimentary variants, we shouldn't report errors
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWzsh@4.3.9,5.11-0.133:20100216T103302Z
2046N/Aset name=org.opensolaris.consolidation value=sfw
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2046N/Aset name=variant.arch value=sparc value=i386
2046N/Aset name=variant.other value=other value=thing
2046N/Aset name=variant.foo value=bar value=baz
2046N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require variant.foo=bar
2046N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
2046N/Adepend fmri=shell/zsh@4.3.9-0.134 type=require variant.foo=baz
2046N/A"""
2046N/A
2081N/Aexpected_failures["novariant_arch.mf"] = ["pkglint.manifest003.3",
2081N/A "pkglint.action005.1", "pkglint.action005.1"]
2081N/Abroken_manifests["novariant_arch.mf"] = \
2081N/A"""
2081N/A#
2081N/A# we don't have a variant.arch attribute set, and are delivering a file with
2081N/A# an elfarch attribute
2081N/A#
2081N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWzsh@4.3.9,5.11-0.133:20100216T103302Z
2081N/Aset name=org.opensolaris.consolidation value=sfw
2081N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2081N/Aset name=description value="Pkglint test package"
2081N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2081N/Aset name=pkg.summary value="Pkglint test package"
2081N/Aset name=variant.other value=other value=thing
2081N/Aset name=variant.foo value=bar value=baz
2081N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require variant.foo=bar
2081N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700
2081N/A"""
2081N/A
2046N/Aexpected_failures["obsolete-has-description.mf"] = ["pkglint.manifest001.1"]
2046N/Abroken_manifests["obsolete-has-description.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We deliver an obsolete package that has a pkg.description
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWaspell@0.5.11,5.11-0.130:20091218T222625Z
2046N/Aset name=pkg.obsolete value=true variant.arch=i386
2046N/Aset name=pkg.description value="This is a package description"
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2046N/Aset name=variant.arch value=i386
2046N/A"""
2046N/A
2046N/Aexpected_failures["obsolete-more-actions.mf"] = ["pkglint.manifest001.2"]
2046N/Abroken_manifests["obsolete-more-actions.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We deliver an obsolete package that has actions other than 'set'.
2046N/A# (bogus signature on this manifest, just for testing)
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWaspell@0.5.11,5.11-0.130:20091218T222625Z
2046N/Aset name=pkg.obsolete value=true variant.arch=i386
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2046N/Aset name=variant.arch value=i386
2046N/Adir mode=0555 owner=root group=sys path=/usr/bin
2046N/Asignature algorithm=sha256 value=75b662e14a4ea8f0fa0507d40133b0347a36bc1f63112487f4738073edf4455d version=0
2046N/A"""
2046N/A
2046N/Aexpected_failures["obsolete.mf"] = []
2046N/Abroken_manifests["obsolete.mf"] = \
2046N/A"""
2046N/A#
2046N/A# This is a perfectly valid example of an obsolete package
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWaspell@0.5.11,5.11-0.130:20091218T222625Z
2046N/Aset name=pkg.obsolete value=true variant.arch=i386
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2046N/Aset name=variant.arch value=i386
2328N/Asignature algorithm=sha256 value=75b662e14a4ea8f0fa0507d40133b0347a36bc1f63112487f4738073edf4455d version=0
2046N/A"""
2046N/A
2434N/Aexpected_failures["obsolete-has-description-linted.mf"] = ["pkglint001.5", "pkglint.action008"]
2434N/Abroken_manifests["obsolete-has-description-linted.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We deliver an obsolete package that has a pkg.description
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWaspell@0.5.11,5.11-0.130:20091218T222625Z
2434N/Aset name=pkg.obsolete value=true variant.arch=i386
2434N/Aset name=pkg.description value="This is a package description" pkg.linted.pkglint.manifest001.1=True
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2434N/Aset name=variant.arch value=i386
2434N/A"""
2434N/A
2434N/Aexpected_failures["obsolete-more-actions-linted.mf"] = ["pkglint.manifest001.2","pkglint.action008"]
2434N/Abroken_manifests["obsolete-more-actions-linted.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We deliver an obsolete package that has actions other than 'set'.
2434N/A# (bogus signature on this manifest, just for testing)
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWaspell@0.5.11,5.11-0.130:20091218T222625Z
2434N/Aset name=pkg.obsolete value=true variant.arch=i386
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2434N/Aset name=variant.arch value=i386
2434N/Adir mode=0555 owner=root group=sys path=/usr/bin pkg.linted.pkglint.action005.1=True
2434N/Asignature algorithm=sha256 value=75b662e14a4ea8f0fa0507d40133b0347a36bc1f63112487f4738073edf4455d version=0
2434N/A"""
2434N/A
2477N/Aexpected_failures["overlay-valid-many-overlays-valid-mismatch.mf"] = []
2477N/Abroken_manifests["overlay-valid-many-overlays-valid-mismatch.mf"] = \
2477N/A"""
2477N/A#
2477N/A# This manifest declares multiple overlay=true action, each under a different
2477N/A# variant, and multiple overlay=allow actions, one of our variants declares a
2477N/A# different mode, which here, should be ok.
2477N/A#
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=variant.bar value=other value=new value=baz
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0755 overlay=allow owner=timf path=foo preserve=true variant.arch=sparc
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=other
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=new
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=baz
2477N/Afile NOHASH group=staff mode=0755 overlay=true owner=timf path=foo variant.arch=sparc
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-valid-many-overlays.mf"] = []
2477N/Abroken_manifests["overlay-valid-many-overlays.mf"] = \
2477N/A"""
2477N/A#
2477N/A# This manifest declares multiple overlay=true action, each under a different
2477N/A# variant, and multiple overlay=allow actions.
2477N/A#
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=variant.bar value=other value=new value=baz
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=other
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=new
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=baz
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=sparc
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=sparc
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-valid-no-allow-overlay-variant.mf"] = []
2477N/Abroken_manifests["overlay-valid-no-allow-overlay-variant.mf"] = \
2477N/A"""
2477N/A#
2477N/A# We have an overlay attribute, but no overlay=allow attribute on the 2nd
2477N/A# action, but since we use use variants, the first action never needs to overlay
2477N/A# another action.
2477N/A#
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=variant.bar value=other value=new
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386 variant.bar=other
2477N/A
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-valid-simple-no-overlay.mf"] = []
2477N/Abroken_manifests["overlay-valid-simple-no-overlay.mf"] = \
2477N/A"""
2477N/A#
2477N/A# A valid manifest which declares two overlay=allow actions across different
2477N/A# variants.
2477N/A#
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=variant.bar value=other value=new
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0655 overlay=allow owner=timf path=foo preserve=true variant.arch=sparc
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-valid-simple-overlay-true.mf"] = []
2477N/Abroken_manifests["overlay-valid-simple-overlay-true.mf"] = \
2477N/A"""
2477N/A#
2477N/A# A valid manifest which just declares an overlay=true action
2477N/A#
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-valid-simple-overlay.mf"] = []
2477N/Abroken_manifests["overlay-valid-simple-overlay.mf"] = \
2477N/A"""
2477N/A#
2477N/A# A basic valid manifest that uses overlays
2477N/A#
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=variant.bar value=other value=new
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo
2477N/Afile NOHASH group=staff mode=0644 overlay=allow preserve=true owner=timf path=foo
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-valid-triple-allowed.mf"] = []
2477N/Abroken_manifests["overlay-valid-triple-allowed.mf"] = \
2477N/A"""
2477N/A#
2477N/A# A valid manifest which has a single overlay=true action, and multiple
2477N/A# overlay=allow actions, each in a different variant.
2477N/A#
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386
2477N/Aset name=variant.bar value=other value=new value=baz
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.bar=other
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.bar=new
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.bar=baz
2477N/A
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-valid-triple-true.mf"] = []
2477N/Abroken_manifests["overlay-valid-triple-true.mf"] = \
2477N/A"""
2477N/A#
2477N/A# This manifest declares multiple overlay=true attributes, each under a
2477N/A# different variant.
2477N/A#
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=variant.bar value=other value=new value=baz
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=other
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=new
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386 variant.bar=baz
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-valid-mismatch-attrs.mf"] = []
2477N/Abroken_manifests["overlay-valid-mismatch-attrs.mf"] = \
2477N/A"""
2477N/A#
2477N/A# We declare overlays, but have mismatching attributes between them
2477N/A# blah=foo differs, but shouldn't matter.
2477N/A#
2477N/Aset name=pkg.fmri value=bar
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc value=ppc
2477N/Aset name=variant.timf value=foo value=bar
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0755 overlay=true owner=timf path=foo variant.arch=ppc variant.timf=foo blah=foo
2477N/Afile NOHASH group=staff mode=0755 overlay=allow owner=timf path=foo preserve=rename variant.arch=ppc variant.timf=foo
2477N/A"""
2477N/A
2477N/A# more overlay checks
2477N/Aexpected_failures["overlay-invalid-broken-attrs.mf"] = ["pkglint.dupaction009.6"]
2477N/Abroken_manifests["overlay-invalid-broken-attrs.mf"] = \
2477N/A"""
2477N/A#
2477N/A# We declare overlays, but have mismatching attributes between them
2477N/A#
2477N/Aset name=pkg.fmri value=bar
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc value=ppc
2477N/Aset name=variant.timf value=foo value=bar
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0755 overlay=true owner=timf path=foo variant.arch=ppc variant.timf=foo blah=foo
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=rename variant.arch=ppc variant.timf=foo
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-duplicate-allows.mf"] = \
2477N/A ["pkglint.dupaction009.3"]
2477N/Abroken_manifests["overlay-invalid-duplicate-allows.mf"] = \
2477N/A"""
2477N/A#
2477N/A# Duplicate overlay=allow actions, with no overlay=true action.
2477N/A#
2477N/Aset name=pkg.fmri value=bar
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc value=ppc
2477N/Aset name=variant.timf value=foo value=bar
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=rename variant.arch=ppc
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=rename variant.arch=ppc
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-duplicate-overlays.mf"] = \
2477N/A ["pkglint.dupaction009.2"]
2477N/Abroken_manifests["overlay-invalid-duplicate-overlays.mf"] = \
2477N/A"""
2477N/A# We have duplicate overlay actions
2477N/A
2477N/Aset name=pkg.fmri value=bar
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc value=ppc
2477N/Aset name=variant.timf value=foo value=bar
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=ppc
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=ppc
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=rename variant.arch=ppc
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-duplicate-pairs.mf"] = \
2477N/A ["pkglint.dupaction009.4", "pkglint.dupaction009.2"]
2477N/Abroken_manifests["overlay-invalid-duplicate-pairs.mf"] = \
2477N/A"""
2477N/A# ensure that depite complimentary pairs of overlay actions,
2477N/A# we still catch the duplicate one
2477N/A
2477N/Aset name=pkg.fmri value=bar
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc value=ppc
2477N/Aset name=variant.timf value=foo value=bar
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=ppc
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=rename variant.arch=ppc
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=ppc
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=rename variant.arch=ppc
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-no-allow-overlay.mf"] = \
2477N/A ["pkglint.dupaction001.2", "pkglint.dupaction009.7",
2477N/A "pkglint.dupaction009.5"]
2477N/Abroken_manifests["overlay-invalid-no-allow-overlay.mf"] = \
2477N/A"""
2477N/A# we have an overlay attribute, but no overlay=allow attribute
2477N/A# on the 2nd action
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=variant.bar value=other value=new
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386
2477N/Afile NOHASH group=staff mode=0644 owner=timf path=foo preserve=true variant.arch=i386
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-no-overlay-allow.mf"] = \
2477N/A ["pkglint.dupaction001.1", "pkglint.dupaction009.7",
2477N/A "pkglint.dupaction009.5"]
2477N/Abroken_manifests["overlay-invalid-no-overlay-allow.mf"] = \
2477N/A"""
2477N/Aset name=pkg.fmri value=bar
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo
2477N/Afile NOHASH group=staff mode=0644 owner=timf path=foo preserve=rename
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-no-overlay-preserve.mf"] = \
2477N/A ["pkglint.dupaction009.1", "pkglint.dupaction009.5"]
2477N/Abroken_manifests["overlay-invalid-no-overlay-preserve.mf"] = \
2477N/A"""
2477N/A# we don't delcare a 'preserve' attribute on our overlay=allow action
2477N/A#
2477N/Aset name=pkg.fmri value=bar
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc value=ppc
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-no-overlay-true.mf"] = \
2477N/A ["pkglint.dupaction001.1", "pkglint.dupaction009.7"]
2477N/Abroken_manifests["overlay-invalid-no-overlay-true.mf"] = \
2477N/A"""
2477N/A# we're missing an overlay=true action, resulting in a duplicate
2477N/Aset name=pkg.fmri value=bar
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=org.opensolaris.consolidation value=ips
2477N/Aset name=variant.arch value=i386
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true
2477N/Afile NOHASH group=staff mode=0644 owner=timf path=foo preserve=rename
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-triple-broken-variants.mf"] = \
2477N/A ["pkglint.dupaction009.4"]
2477N/Abroken_manifests["overlay-invalid-triple-broken-variants.mf"] = \
2477N/A"""
2477N/A# this package declares overlay actions, but we have duplicate
2477N/A# overlay='allow' attributes for variant.foo=foo1
2477N/A
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386
2477N/Aset name=variant.bar value=other value=new value=baz
2477N/Aset name=variant.foo value=foo1 value=foo2
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.bar=other
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.bar=new variant.foo=foo1
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.bar=new variant.foo=foo2
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386 variant.bar=new variant.foo=foo1
2477N/A"""
2477N/A
2477N/Aexpected_failures["overlay-invalid-triple-broken.mf"] = \
2477N/A ["pkglint.dupaction009.4"]
2477N/Abroken_manifests["overlay-invalid-triple-broken.mf"] = \
2477N/A"""
2477N/A# this manifest has multiple overlay=allow variants, but the last is
2477N/A# duplicated across variant.bar variants
2477N/Aset name=pkg.fmri value=foo
2477N/Aset name=pkg.summary value="Image Packaging System"
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Aset name=pkg.description value="overlay checks"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=variant.bar value=other value=new value=baz
2477N/Aset name=org.opensolaris.consolidation value=pkg
2477N/A
2477N/Afile NOHASH group=staff mode=0644 overlay=true owner=timf path=foo variant.arch=i386
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386 variant.bar=other
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386 variant.bar=new
2477N/Afile NOHASH group=staff mode=0644 overlay=allow owner=timf path=foo preserve=true variant.arch=i386
2477N/A"""
2477N/A
2731N/Aexpected_failures["parent_is_not_dir.mf"] = ["pkglint.dupaction011"]
2731N/Abroken_manifests["parent_is_not_dir.mf"] = \
2731N/A"""
2731N/A# This manifest delivers /usr/bin as a symlink to /bin, but tries to install
2731N/A# a file through that symlink.
2731N/A#
2731N/Aset name=pkg.fmri value=foo
2731N/Aset name=pkg.summary value="Image Packaging System"
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2731N/Aset name=pkg.description value="overlay checks"
2731N/Aset name=variant.arch value=i386 value=sparc
2731N/Aset name=org.opensolaris.consolidation value=pkg
2731N/Adir path=/bin owner=root group=sys mode=0755
2731N/Alink target=../bin path=usr/bin group=sys owner=root
2731N/Afile /etc/motd group=sys mode=0644 owner=root path=usr/bin/foo
2731N/A"""
2731N/A
2731N/Aexpected_failures["parent_is_not_dir_variants.mf"] = []
2731N/Abroken_manifests["parent_is_not_dir_variants.mf"] = \
2731N/A"""
2731N/A# This manifest delivers /usr/bin as a symlink to /bin, but tries to install
2731N/A# a file through that symlink. However, since the symlink and the file are
2731N/A# delivered under different variants, this is acceptable
2731N/A#
2731N/Aset name=pkg.fmri value=foo
2731N/Aset name=pkg.summary value="Image Packaging System"
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2731N/Aset name=pkg.description value="overlay checks"
2731N/Aset name=variant.arch value=i386 value=sparc
2731N/Aset name=variant.bar value=other value=new value=baz
2731N/Aset name=org.opensolaris.consolidation value=pkg
2731N/Adir path=/bin owner=root group=sys mode=0755
2731N/Alink target=../bin path=usr/bin group=sys owner=root variant.bar=other
2731N/Afile /etc/motd group=sys mode=0644 owner=root path=usr/bin/foo variant.bar=new
2731N/A"""
2731N/A
2147N/Aexpected_failures["renamed-more-actions.mf"] = ["pkglint.manifest002.1",
2147N/A "pkglint.manifest002.3"]
2046N/Abroken_manifests["renamed-more-actions.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We've reported a package as having been renamed, yet try to deliver
2046N/A# actions other than 'set' and 'depend'
2046N/A# (bogus signature on this manifest, just for testing)
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWzsh@4.3.9,5.11-0.133:20100216T103302Z
2046N/Aset name=org.opensolaris.consolidation value=sfw
2046N/Aset name=pkg.renamed value=true
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.arch value=sparc value=i386
2046N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require
2046N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
2046N/Adir mode=0555 owner=root group=sys path=/usr/bin
2046N/Asignature algorithm=sha256 value=75b662e14a4ea8f0fa0507d40133b0347a36bc1f63112487f4738073edf4455d version=0
2046N/A"""
2046N/A
2434N/Aexpected_failures["renamed-more-actions-linted.mf"] = ["pkglint.manifest002.3",
2434N/A "pkglint.action008", "pkglint001.5"]
2434N/Abroken_manifests["renamed-more-actions-linted.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We've reported a package as having been renamed, yet try to deliver
2434N/A# actions other than 'set' and 'depend'. The additional actions are marked
2434N/A# as linted.
2434N/A# (bogus signature on this manifest, just for testing)
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWzsh@4.3.9,5.11-0.133:20100216T103302Z
2434N/Aset name=org.opensolaris.consolidation value=sfw
2434N/Aset name=pkg.renamed value=true
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/Aset name=variant.arch value=sparc value=i386
2434N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require
2434N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
2434N/Adir mode=0555 owner=root group=sys path=/usr/bin pkg.linted.pkglint.manifest002.1=True
2434N/Asignature algorithm=sha256 value=75b662e14a4ea8f0fa0507d40133b0347a36bc1f63112487f4738073edf4455d version=0
2434N/A"""
2434N/A
2434N/Aexpected_failures["renamed-more-actions-not-all-linted.mf"] = \
2434N/A ["pkglint.manifest002.1", "pkglint.manifest002.3", "pkglint.action008"]
2434N/Abroken_manifests["renamed-more-actions-not-all-linted.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We've reported a package as having been renamed, yet try to deliver
2434N/A# actions other than 'set' and 'depend'. One of these additional actions
2434N/A# is linted, but not all of them, so we still throw pkglint.manifest002.1
2434N/A# (bogus signature on this manifest, just for testing)
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWzsh@4.3.9,5.11-0.133:20100216T103302Z
2434N/Aset name=org.opensolaris.consolidation value=sfw
2434N/Aset name=pkg.renamed value=true
2434N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2434N/Aset name=variant.arch value=sparc value=i386
2434N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require
2434N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
2434N/Adir mode=0555 owner=root group=sys path=/usr/bin pkg.linted.pkglint.manifest002.1=True
2434N/Adir mode=0555 owner=root group=sys path=/usr/lib
2434N/Asignature algorithm=sha256 value=75b662e14a4ea8f0fa0507d40133b0347a36bc1f63112487f4738073edf4455d version=0
2434N/A"""
2434N/A
2147N/Aexpected_failures["renamed.mf"] = ["pkglint.manifest002.3"]
2046N/Abroken_manifests["renamed.mf"] = \
2046N/A"""
2046N/A#
2046N/A# This is a perfectly valid example of a renamed package
2046N/A# (bogus signature on this manifest, just for testing)
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWzsh@4.3.9,5.11-0.133:20100216T103302Z
2046N/Aset name=org.opensolaris.consolidation value=sfw
2046N/Aset name=pkg.renamed value=true
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.arch value=sparc value=i386
2046N/Adepend fmri=shell/zsh@4.3.9-0.133 type=require
2046N/Adepend fmri=consolidation/sfw/sfw-incorporation type=require
2046N/Asignature algorithm=sha256 value=75b662e14a4ea8f0fa0507d40133b0347a36bc1f63112487f4738073edf4455d version=0
2046N/A"""
2046N/A
2715N/Aexpected_failures["renamed-self.mf"] = ["pkglint.manifest002.4"]
2715N/Abroken_manifests["renamed-self.mf"] = """
2715N/A#
2715N/A# We try to rename to ourself.
2715N/A#
2715N/Aset name=pkg.fmri value=pkg://opensolaris.org/renamed-ancestor-new@0.5.11,5.11-0.141
2715N/Aset name=pkg.description value="additional reference actions for pkglint"
2715N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2715N/Aset name=pkg.summary value="Core Solaris Kernel"
2715N/Aset name=org.opensolaris.consolidation value=osnet
2715N/Aset name=variant.arch value=i386 value=sparc
2715N/Aset name=pkg.renamed value=true
2715N/Adepend fmri=renamed-ancestor-new type=require
2715N/A"""
2715N/A
2731N/Aexpected_failures["smf-manifest.mf"] = []
2731N/Abroken_manifests["smf-manifest.mf"] = """
2731N/A#
2731N/A# We deliver SMF manifests, with correct org.opensolaris.smf.fmri tags
2731N/A#
2731N/Aset name=pkg.fmri value=pkg://opensolaris.org/smf-package@0.5.11,5.11-0.141
2731N/Aset name=pkg.description value="additional reference actions for pkglint"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/foo/bar value=svc:/foo/bar:default \
2731N/A value=svc:/application/foo/bar value=svc:/application/foo/bar:instance
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2731N/Aset name=pkg.summary value="Core Solaris Kernel"
2731N/Aset name=org.opensolaris.consolidation value=osnet
2731N/Aset name=variant.arch value=i386 value=sparc
2731N/Afile path=lib/svc/manifest/file.xml owner=root group=sys mode=644
2731N/Afile path=var/svc/manifest/application/file.xml owner=root group=sys mode=644
2731N/A"""
2731N/A
2731N/Aexpected_failures["smf-manifest_broken.mf"] = ["pkglint.manifest011"]
2731N/Abroken_manifests["smf-manifest_broken.mf"] = """
2731N/A#
2731N/A# We deliver SMF manifests, but don't declare an org.opensolaris.smf.fmri tag
2731N/A# We should get one warning, rather than one per-SMF-manifest
2731N/A#
2731N/Aset name=pkg.fmri value=pkg://opensolaris.org/smf-package@0.5.11,5.11-0.141
2731N/Aset name=pkg.description value="additional reference actions for pkglint"
2731N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2731N/Aset name=pkg.summary value="Core Solaris Kernel"
2731N/Aset name=org.opensolaris.consolidation value=osnet
2731N/Aset name=variant.arch value=i386 value=sparc
2731N/Afile path=lib/svc/manifest/file.xml owner=root group=sys mode=644
2731N/Afile path=var/svc/manifest/application/file.xml owner=root group=sys mode=644
2731N/A# these files are a red herrings - they deliver to the manifest dirs, but do not
2731N/A# have ".xml" file extensions
2731N/Afile path=lib/svc/manifest/README owner=root group=sys mode=644
2731N/Afile path=var/svc/manifest/sample.db owner=root group=sys mode=644
2731N/A"""
2731N/A
2434N/Aexpected_failures["underscores.mf"] = ["pkglint.action001.1",
3307N/A "pkglint.action001.3", "pkglint.action001.2", "pkglint.action001.1"]
2147N/Abroken_manifests["underscores.mf"] = \
2147N/A"""
2147N/A#
2147N/A# We try to deliver attributes with underscores.
2147N/A#
2147N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/underscores@0.5.11,5.11-0.141:20100603T215050Z
2147N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2147N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2147N/Aset name=pkg.summary value="Core Solaris Kernel"
2147N/Aset name=org.opensolaris.consolidation value=osnet
2147N/Aset name=variant.arch value=i386 value=sparc
2147N/Aset name=test value=i386 variant.arch=sparc
2147N/Aset name=this_underscore_check value=i386 another_attribute=False
2147N/Aset name=info.source_url value=http://www.sun.com
3307N/A# reboot_needed is a typo (should be reboot-needed); so should cause a warning
2147N/Adir group=bin mode=0755 owner=root path=usr/lib/X11 reboot_needed=False
2147N/A"""
2147N/A
2046N/Aexpected_failures["undescribed-variant.mf"] = ["pkglint.manifest003.1"]
2046N/Abroken_manifests["undescribed-variant.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we try to set a variant we've never described in the manifest
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.arch value=i386 value=sparc
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default variant.noodles=singapore
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2046N/Aexpected_failures["unknown-variant.mf"] = ["pkglint.manifest003.2"]
2046N/Abroken_manifests["unknown-variant.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we try to deliver an action with a variant value we haven't described
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2046N/Aset name=variant.arch value=i386 value=sparc
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default variant.opensolaris.zone=foo
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2597N/Aexpected_failures["ignorable-variant.mf"] = []
2597N/Abroken_manifests["ignorable-variant.mf"] = \
2597N/A"""
2597N/A#
2597N/A# we deliver an undefined, but ignorable variant
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=pkg.description value="Description of pkglint test package"
2597N/Aset name=description value="Pkglint test package"
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2597N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2597N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2597N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default variant.opensolaris.zone=global
3382N/Afile nohash variant.debug.osnet=True elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2597N/A"""
2597N/A
2597N/Aexpected_failures["ignorable-unknown-variant.mf"] = ["pkglint.manifest003.2"]
2597N/Abroken_manifests["ignorable-unknown-variant.mf"] = \
2597N/A"""
2597N/A#
2597N/A# we try to deliver an action with a variant value we haven't described,
2597N/A# as well as an ignorable variant - we should still get an error
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=pkg.description value="Description of pkglint test package"
2597N/Aset name=description value="Pkglint test package"
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Aset name=pkg.summary value="Pkglint test package"
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2597N/Adir group=bin mode=0755 owner=root path=usr/lib/X11
2597N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2597N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default variant.opensolaris.zone=foo
3382N/Afile nohash variant.debug.osnet=True elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2597N/A"""
2597N/A
2046N/Aexpected_failures["unknown.mf"] = ["pkglint.action004"]
2046N/Abroken_manifests["unknown.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We try to deliver an 'unknown' action
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aunknown name="no idea"
2046N/A"""
2046N/A
2046N/Aexpected_failures["unusual_mode_noexecdir.mf"] = ["pkglint.action002.1",
2147N/A "pkglint.action002.4"]
2046N/Abroken_manifests["unusual_mode_noexecdir.mf"] = \
2046N/A"""
2046N/A#
2046N/A# we deliver a directory with an unexecutable mode 0422
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.1.0,5.11-0.141:20100604T143737Z
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2213N/Aset name=pkg.description value="Description of pkglint test package"
2046N/Aset name=description value="Pkglint test package"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2046N/Aset name=pkg.summary value="Pkglint test package"
2046N/Aset name=variant.arch value=i386 value=sparc
2731N/Aset name=org.opensolaris.smf.fmri value=svc:/application/x11/xfs:default
2046N/Adir group=bin mode=0424 owner=root path=usr/lib/X11
2046N/Adir group=bin mode=0755 alt=foo owner=root path=usr/lib/X11/fs
2046N/Afile nohash group=bin mode=0755 owner=root path=usr/sbin/fsadmin pkg.csize=1234 pkg.size=1234
2046N/Afile nohash group=sys mode=0444 owner=root path=var/svc/manifest/application/x11/xfs.xml pkg.csize=1649 pkg.size=3534 restart_fmri=svc:/system/manifest-import:default
3382N/Afile nohash elfarch=i386 elfbits=64 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
2046N/A"""
2046N/A
2477N/Aexpected_failures["action_validation.mf" ] = ["pkglint.action009"]
2477N/Abroken_manifests["action_validation.mf" ] = \
2477N/A"""
2477N/A#
2477N/A# We deliver an intentionally broken file action
2477N/A#
2477N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2477N/Aset name=org.opensolaris.consolidation value=osnet
2477N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2477N/Aset name=pkg.description value="A pkglint test"
2477N/Aset name=pkg.summary value="Yet another test"
2477N/Aset name=variant.arch value=i386 value=sparc
2477N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2477N/Afile nohash path=/dev/null
2477N/A"""
2477N/A
2434N/Aexpected_failures["whitelist_action_missing_dep.mf"] = []
2434N/Abroken_manifests["whitelist_action_missing_dep.mf"] = \
2434N/A"""
2434N/A#
2434N/A#
2434N/A# We declare a pkg.lint.pkglint.action005.1 parameter to a depend action that
2434N/A# tells the check to ignore any missing dependencies, as part of its package
2434N/A# obsoletion test
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Adepend type=require fmri=test/package pkg.lint.pkglint.action005.1.missing-deps=pkg:/test/package
2434N/A"""
2434N/A
2434N/Aexpected_failures["whitelist_mf_missing_dep.mf"] = []
2434N/Abroken_manifests["whitelist_mf_missing_dep.mf"] = \
2434N/A"""
2434N/A#
2434N/A# We declare a pkg.lint.pkglint.action005.1 parameter that tells the check to
2434N/A# ignore any missing dependencies, as part of its package obsoletion test
2434N/A#
2434N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2434N/Aset name=org.opensolaris.consolidation value=osnet
2434N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2434N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2434N/Aset name=pkg.summary value="Core Solaris Kernel"
2434N/Aset name=variant.arch value=i386 value=sparc
2434N/Aset name=pkg.lint.pkglint.action005.1.missing-deps value=pkg:/test/package value=pkg:/other/package
2434N/Adepend type=require fmri=test/package
2434N/A"""
2434N/A
2498N/Aexpected_failures["okay_underscores.mf"] = []
2498N/Abroken_manifests["okay_underscores.mf"] = \
2498N/A"""
2498N/A#
2498N/A# Underscores in attribute names generate warnings, except for a few that are
2498N/A# grandfathered in, locale facets, which have locale names in them, and
2498N/A# version-lock facets, which take package names.
2498N/A#
2498N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
2498N/Aset name=org.opensolaris.consolidation value=osnet
2498N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2498N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2498N/Aset name=pkg.summary value="Core Solaris Kernel"
2498N/Aset name=variant.arch value=i386 value=sparc
2498N/Adepend type=incorporate fmri=system/blah_blah@0.5.11-0.172 facet.version-lock.system/blah_blah=true
2498N/Alink path=usr/lib/locale/en_US.UTF-8/foo.mo target=bar.mo facet.locale.en_US=true
2498N/Alink path=usr/bin/foo1 target=bar restart_fmri=true
2498N/Alink path=usr/bin/foo2 target=bar refresh_fmri=true
2498N/Alink path=usr/bin/foo3 target=bar suspend_fmri=true
2498N/Alink path=usr/bin/foo4 target=bar disable_fmri=true
2498N/Alink path=usr/bin/foo6 target=bar clone_perms="* 0666 root root"
2498N/Alink path=usr/bin/foo7 target=bar original_name=SUNWcar:usr/bin/wazaap
2498N/A"""
2498N/A
2597N/Aexpected_failures["mediated_links.mf" ] = []
2597N/Abroken_manifests["mediated_links.mf" ] = \
2597N/A"""
2597N/A#
2597N/A# A perfectly valid manifest that uses mediated links
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=pkg.description value="A pkglint test"
2597N/Aset name=pkg.summary value="Yet another test"
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Alink path=usr/bin/perl target=usr/perl5/5.6/bin/perl mediator=perl mediator-version=5.6
2597N/Alink path=usr/bin/perl target=usr/perl5/5.12/bin/perl mediator=perl mediator-version=5.12
2597N/Afile path=usr/perl5/5.6/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/perl5/5.12/bin/perl owner=root group=sys mode=0755
2597N/A"""
2597N/A
2597N/Aexpected_failures["mediated_links-dup_file.mf" ] = ["pkglint.dupaction010.1"]
2597N/Abroken_manifests["mediated_links-dup_file.mf" ] = \
2597N/A"""
2597N/A#
2597N/A# We use mediated links, but also try to deliver a file using the same path as
2597N/A# that mediated link
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=pkg.description value="A pkglint test"
2597N/Aset name=pkg.summary value="Yet another test"
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Alink path=usr/bin/perl target=usr/perl5/5.6/bin/perl mediator=perl mediator-version=5.6
2597N/Alink path=usr/bin/perl target=usr/perl5/5.12/bin/perl mediator=perl mediator-version=5.12
2597N/Afile path=usr/perl5/5.6/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/perl5/5.12/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/bin/perl owner=root group=sys mode=0755
2597N/A"""
2597N/A
2597N/Aexpected_failures["mediated_links-types.mf" ] = ["pkglint.dupaction010.1"]
2597N/Abroken_manifests["mediated_links-types.mf" ] = \
2597N/A"""
2597N/A#
2597N/A# We use mediated links, but then also try to deliver a directory over that link
2597N/A# this is similar to the last test, but ensures that reference-counted
2597N/A# duplicates are treated the same way as non-reference counted duplicates.
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=pkg.description value="A pkglint test"
2597N/Aset name=pkg.summary value="Yet another test"
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Alink path=usr/bin/perl target=usr/perl5/5.6/bin/perl mediator=perl mediator-version=5.6
2597N/Alink path=usr/bin/perl target=usr/perl5/5.12/bin/perl mediator=perl mediator-version=5.12
2597N/Afile path=usr/perl5/5.6/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/perl5/5.12/bin/perl owner=root group=sys mode=0755
2597N/Adir path=usr/bin/perl owner=root group=sys mode=0755
2597N/A"""
2597N/A
2597N/Aexpected_failures["mediated_links-variants.mf" ] = []
2597N/Abroken_manifests["mediated_links-variants.mf" ] = \
2597N/A"""
2597N/A#
2597N/A# We use mediated links, but only in the nonglobal zone, with a file
2597N/A# in the global zone
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=pkg.description value="A pkglint test"
2597N/Aset name=pkg.summary value="Yet another test"
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Alink path=usr/bin/perl target=usr/perl5/5.6/bin/perl mediator=perl mediator-version=5.6 variant.opensolaris.zone=nonglobal
2597N/Alink path=usr/bin/perl target=usr/perl5/5.12/bin/perl mediator=perl mediator-version=5.12 variant.opensolaris.zone=nonglobal
2597N/Afile path=usr/perl5/5.6/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/perl5/5.12/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/bin/perl owner=root group=sys mode=0755 variant.opensolaris.zone=global
2597N/A"""
2597N/A
2597N/Aexpected_failures["mediated_links-missing-mediator.mf" ] = ["pkglint.dupaction010.2"]
2597N/Abroken_manifests["mediated_links-missing-mediator.mf" ] = \
2597N/A"""
2597N/A#
2597N/A# We're missing mediated link attributes on one of our links
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=pkg.description value="A pkglint test"
2597N/Aset name=pkg.summary value="Yet another test"
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Alink path=usr/bin/perl target=usr/perl5/5.6/bin/perl mediator=perl mediator-version=5.6
2597N/Alink path=usr/bin/perl target=usr/perl5/5.12/bin/perl
2597N/Afile path=usr/perl5/5.6/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/perl5/5.12/bin/perl owner=root group=sys mode=0755
2597N/A"""
2597N/A
2597N/Aexpected_failures["mediated_links-namespaces.mf" ] = ["pkglint.dupaction010.3"]
2597N/Abroken_manifests["mediated_links-namespaces.mf" ] = \
2597N/A"""
2597N/A#
2597N/A# Our mediated links deliver the same path to different namespaces
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=pkg.description value="A pkglint test"
2597N/Aset name=pkg.summary value="Yet another test"
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Alink path=usr/bin/perl target=usr/perl5/5.6/bin/perl mediator=perl mediator-version=5.6
2597N/Alink path=usr/bin/perl target=usr/perl5/5.12/bin/perl mediator=perl5 mediator-version=5.12
2597N/Afile path=usr/perl5/5.6/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/perl5/5.12/bin/perl owner=root group=sys mode=0755
2597N/A"""
2597N/A
2597N/Aexpected_failures["mediated_links-missing-attrs.mf" ] = ["pkglint.action009"]
2597N/Abroken_manifests["mediated_links-missing-attrs.mf" ] = \
2597N/A"""
2597N/A#
2597N/A# One of our mediated links is missing mediator-version/impl, causing a
2597N/A# general action validation error.
2597N/A#
2597N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2597N/Aset name=org.opensolaris.consolidation value=osnet
2597N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2597N/Aset name=pkg.description value="A pkglint test"
2597N/Aset name=pkg.summary value="Yet another test"
2597N/Aset name=variant.arch value=i386 value=sparc
2597N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2597N/Alink path=usr/bin/perl target=usr/perl5/5.6/bin/perl mediator=perl
2597N/Alink path=usr/bin/perl target=usr/perl5/5.12/bin/perl mediator=perl mediator-version=5.12
2597N/Afile path=usr/perl5/5.6/bin/perl owner=root group=sys mode=0755
2597N/Afile path=usr/perl5/5.12/bin/perl owner=root group=sys mode=0755
2597N/A"""
2597N/A
2861N/Aexpected_failures["noversion-incorp.mf" ] = ["pkglint.action011"]
2861N/Abroken_manifests["noversion-incorp.mf" ] = \
2861N/A"""
2861N/A#
2861N/A# We deliver an 'incorporate' dependency without specifying the version.
2861N/A#
2861N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2861N/Aset name=org.opensolaris.consolidation value=osnet
2861N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2861N/Aset name=pkg.description value="A pkglint test"
2861N/Aset name=pkg.summary value="Yet another test"
2861N/Aset name=variant.arch value=i386 value=sparc
2861N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2861N/Adepend type=incorporate fmri=pkg:/some/package
2861N/A"""
2861N/A
2943N/Aexpected_failures["facetvalue-invalid.mf" ] = ["pkglint.action012"]
2943N/Abroken_manifests["facetvalue-invalid.mf" ] = \
2943N/A"""
2943N/A#
2943N/A# Intentionally set facet into a value other than 'true', 'false' or 'all'
2943N/A#
2943N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
2943N/Aset name=org.opensolaris.consolidation value=osnet
2943N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2943N/Aset name=pkg.description value="A pkglint test"
2943N/Aset name=pkg.summary value="Yet another test"
2943N/Aset name=variant.arch value=i386 value=sparc
2943N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
2943N/Alink path=usr/bin/perl target=usr/perl5/5.6/bin/perl mediator=perl mediator-version=5.6
2943N/Alink path=usr/bin/perl target=usr/perl5/5.12/bin/perl mediator=perl mediator-version=5.12
2943N/Afile path=usr/perl5/5.6/bin/perl facet.doc.man=other owner=root group=sys mode=0755
2943N/Afile path=usr/perl5/5.12/bin/perl owner=root group=sys mode=0755
2943N/A"""
2861N/A
3382N/Aexpected_failures["file-elfbits32.mf"] = ["pkglint.action014.1"]
3382N/Abroken_manifests["file-elfbits32.mf"] = \
3382N/A"""
3382N/A#
3382N/A# One of the file has elfbits=32, causing an elfbits validation error.
3382N/A#
3382N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
3382N/Aset name=org.opensolaris.consolidation value=osnet
3382N/Aset name=variant.opensolaris.zone value=global value=nonglobal
3382N/Aset name=pkg.description value="A pkglint test"
3382N/Aset name=pkg.summary value="Yet another test"
3382N/Aset name=variant.arch value=i386 value=sparc
3382N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
3382N/Afile nohash elfarch=i386 elfbits=32 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/bin/xfs pkg.csize=68397 pkg.size=177700 variant.arch=i386
3382N/A"""
3382N/A
3382N/Aexpected_failures["so-elfbits32.mf"] = []
3382N/Abroken_manifests["so-elfbits32.mf"] = \
3382N/A"""
3382N/A#
3382N/A# Should not cause validation error if an so file has elfbits=32.
3382N/A#
3382N/Aset name=pkg.fmri value=pkg://opensolaris.org/pkglint/test@1.0,1.0
3382N/Aset name=org.opensolaris.consolidation value=osnet
3382N/Aset name=variant.opensolaris.zone value=global value=nonglobal
3382N/Aset name=pkg.description value="A pkglint test"
3382N/Aset name=pkg.summary value="Yet another test"
3382N/Aset name=variant.arch value=i386 value=sparc
3382N/Aset name=info.classification value=org.opensolaris.category.2008:System/Packaging
3382N/Afile nohash elfarch=i386 elfbits=32 elfhash=2d5abc9b99e65c52c1afde443e9c5da7a6fcdb1e group=bin mode=0755 owner=root path=usr/lib/xfs.so pkg.csize=68397 pkg.size=177700 variant.arch=i386
3382N/A"""
3382N/A
3466N/Aexpected_failures["valid_usernames.mf"] = []
3466N/Abroken_manifests["valid_usernames.mf"] = \
3466N/A"""
3466N/A#
3466N/A# Usernames are allowed to contain digit zero.
3466N/A#
3466N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141:20100603T215050Z
3466N/Aset name=org.opensolaris.consolidation value=osnet
3466N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
3466N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
3466N/Aset name=pkg.summary value="Core Solaris Kernel"
3466N/Aset name=variant.arch value=i386 value=sparc
3466N/Auser gcos-field="pkg(7) server UID" group=pkg5srv uid=97 username="pkg5s0v"
3466N/A"""
3466N/A
2046N/Aclass TestLogFormatter(log.LogFormatter):
2046N/A """Records log messages to a buffer"""
2046N/A def __init__(self):
2046N/A self.messages = []
2046N/A self.ids = []
2046N/A super(TestLogFormatter, self).__init__()
2046N/A
2434N/A def format(self, msg, ignore_linted=False):
2046N/A if isinstance(msg, log.LintMessage):
2434N/A linted_flag = False
2434N/A try:
2434N/A linted_flag = linted(action=self.action,
2434N/A manifest=self.manifest, lint_id=msg.msgid)
3171N/A except DuplicateLintedAttrException as err:
3158N/A self.messages.append("{0}\t{1}".format(
3158N/A "pkglint001.6", "Logging error: {0}".format(err)))
2434N/A self.ids.append("pkglint001.6")
2434N/A
2434N/A if linted_flag and not ignore_linted:
2434N/A linted_msg = (
3158N/A "Linted message: {id} {msg}").format(
3158N/A id=msg.msgid, msg=msg)
3158N/A self.messages.append("{0}\t{1}".format(
3158N/A "pkglint001.5", linted_msg))
2434N/A self.ids.append("pkglint001.5")
2434N/A return
2434N/A
2046N/A if msg.level >= self.level:
3158N/A self.messages.append("{0}\t{1}".format(
3158N/A msg.msgid, str(msg)))
2046N/A self.ids.append(msg.msgid)
2046N/A
2046N/A def close(self):
2046N/A self.messages = []
2046N/A self.ids = []
2046N/A
2046N/Aclass TestLintEngine(pkg5unittest.Pkg5TestCase):
2046N/A
2046N/A def test_lint_checks(self):
2046N/A """Ensure that lint checks are functioning."""
2046N/A
2046N/A paths = self.make_misc_files(broken_manifests)
2046N/A paths.sort()
2046N/A
2046N/A for manifest in paths:
3158N/A self.debug("running lint checks on {0}".format(manifest))
2046N/A basename = os.path.basename(manifest)
2046N/A lint_logger = TestLogFormatter()
2046N/A lint_engine = engine.LintEngine(lint_logger,
2085N/A config_file=os.path.join(self.test_root,
2085N/A "pkglintrc"), use_tracker=False)
2046N/A
2046N/A manifests = read_manifests([manifest], lint_logger)
2046N/A lint_engine.setup(lint_manifests=manifests)
2046N/A
2046N/A lint_engine.execute()
2046N/A lint_engine.teardown()
2046N/A
2434N/A # look for pkglint001.3 in the output, regardless
2434N/A # of whether we marked that as linted, since it
2434N/A # indicates we caught an exception in one of the
2434N/A # Checker methods.
2434N/A for message in lint_logger.messages:
3339N/A self.assertTrue("pkglint001.3" not in message,
3158N/A "Checker exception thrown for {0}: {1}".format(
3158N/A basename, message))
2434N/A
2046N/A expected = len(expected_failures[basename])
2046N/A actual = len(lint_logger.messages)
2046N/A if (actual != expected):
2046N/A self.debug("\n".join(lint_logger.messages))
3339N/A self.assertTrue(actual == expected,
3158N/A "Expected {0} failures for {1}, got {2}: {3}".format(
3158N/A expected, basename, actual,
2046N/A "\n".join(lint_logger.messages)))
2046N/A else:
2046N/A reported = lint_logger.ids
2046N/A known = expected_failures[basename]
2046N/A reported.sort()
2046N/A known.sort()
2046N/A for i in range(0, len(reported)):
3339N/A self.assertTrue(reported[i] == known[i],
2085N/A "Differences in reported vs. "
3158N/A "expected lint ids for {0}: "
3158N/A "{1} vs. {2}\n{3}".format(
3158N/A basename, str(reported),
2434N/A str(known),
2434N/A "\n".join(lint_logger.messages)))
2046N/A lint_logger.close()
2046N/A
2085N/A def test_info_classification_data(self):
2085N/A """info.classification check can deal with bad data files."""
2085N/A
2085N/A paths = self.make_misc_files(
2085N/A {"info_class_valid.mf":
2085N/A broken_manifests["info_class_valid.mf"]})
2085N/A
3158N/A empty_file = "{0}/empty_file".format(self.test_root)
2085N/A open(empty_file, "w").close()
2085N/A
3158N/A bad_file = "{0}/bad_file".format(self.test_root)
2085N/A f = open(bad_file, "w")
2085N/A f.write("nothing here")
2085N/A f.close()
2085N/A
2085N/A mf_path = paths.pop()
2085N/A
2085N/A lint_logger = TestLogFormatter()
2085N/A manifests = read_manifests([mf_path], lint_logger)
2085N/A
2085N/A for classification_path in ["/dev/null", "/", empty_file,
2085N/A bad_file]:
2085N/A
2085N/A rcfile = self.configure_rcfile(
2085N/A os.path.join(self.test_root, "pkglintrc"),
2085N/A {"info_classification_path": classification_path},
2085N/A self.test_root, section="pkglint", suffix=".tmp")
2085N/A
2085N/A lint_engine = engine.LintEngine(lint_logger,
2085N/A config_file=rcfile,
2085N/A use_tracker=False)
2085N/A
2085N/A lint_engine.setup(lint_manifests=manifests)
2085N/A lint_engine.execute()
3339N/A self.assertTrue(
2731N/A lint_logger.ids == ["pkglint.manifest008.1"],
3158N/A "Unexpected errors encountered: {0}".format(
3158N/A lint_logger.messages))
2085N/A lint_logger.close()
2085N/A
2776N/A
2046N/Aclass TestLintEngineDepot(pkg5unittest.ManyDepotTestCase):
2046N/A """Tests that exercise reference vs. lint repository checks
2046N/A and test linting of multiple packages at once."""
2046N/A
2715N/A persistent_setup = True
2715N/A
2046N/A ref_mf = {}
2046N/A
2046N/A ref_mf["ref-ancient-sample1.mf"] = """
2046N/A#
2046N/A# A sample package which delivers several actions, to an earlier release than
2046N/A# 0.140. This manifest has an intentional error, which we should detect when
2046N/A# linting against build 139.
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.139
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Afile /etc/passwd path=etc/passwd group=sys mode=0644 owner=root preserve=true
2046N/Afile /etc/passwd path=etc/passwd group=sys mode=0644 owner=root preserve=true
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/A"""
2046N/A
2046N/A ref_mf["ref-old-sample1.mf"] = """
2046N/A#
2046N/A# A sample package which delivers several actions, to an earlier release than
2046N/A# 0.141
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.140
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Afile /etc/passwd path=etc/passwd group=sys mode=0644 owner=root preserve=true
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/A"""
2046N/A ref_mf["ref-sample1.mf"] = """
2046N/A#
2046N/A# A sample package which delivers several actions, to 0.141
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141
2046N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Afile /etc/passwd path=etc/passwd group=sys mode=0644 owner=root preserve=true
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/A"""
2046N/A
2046N/A ref_mf["ref-sample2.mf"] = """
2046N/A#
2046N/A# A sample package which delivers several actions
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/additional@0.5.11,5.11-0.141
2046N/Aset name=pkg.description value="additional reference actions for pkglint"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Afile /etc/motd group=sys mode=0644 owner=root path=etc/motd
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/A"""
2046N/A
2046N/A ref_mf["ref-sample3.mf"] = """
2046N/A#
2046N/A# A sample package which delivers several actions
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/more@0.5.11,5.11-0.141
2046N/Aset name=pkg.description value="additional reference actions for pkglint"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Afile /etc/group group=sys mode=0644 owner=root path=etc/group
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/A"""
2081N/A
2081N/A ref_mf["ref-sample4-not-obsolete"] = """
2081N/A#
2081N/A# This is not an obsolete package - used to check versioning
2081N/A#
2081N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/obsolete@0.5.11,5.11-0.140
2081N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2081N/Aset name=variant.arch value=i386
2081N/A"""
2081N/A
2081N/A ref_mf["ref-sample4-obsolete"] = """
2081N/A#
2081N/A# This is a perfectly valid example of an obsolete package
2081N/A#
2081N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/obsolete@0.5.11,5.11-0.141
2081N/Aset name=pkg.obsolete value=true variant.arch=i386
2081N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2081N/Aset name=variant.arch value=i386
2081N/A"""
2081N/A
2046N/A ref_mf["dummy-ancestor.mf"] = """
2046N/A#
2046N/A# This is a dummy package designed trip a lint of no-ancestor-legacy.mf
2147N/A# we don't declare a dependency on the package delivering the legacy action.
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWckr@0.5.11,5.11-0.141
2046N/Aset name=pkg.description value="additional reference actions for pkglint"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2147N/Aset name=pkg.renamed value=true
2046N/Aset name=variant.arch value=i386 value=sparc
2147N/Adepend fmri=system/more type=require
2046N/A"""
2046N/A
2091N/A ref_mf["twovar.mf"] = """
2091N/A#
2091N/A# This package shares the kernel/strmod path with onevar.mf but has a different
2091N/A# set of variants for both the action and the package. This should not cause
2091N/A# an assertion to be raised.
2091N/A#
2091N/Aset name=variant.arch value=sparc value=i386
2091N/Aset name=pkg.summary value="A packge with two variant values"
2091N/Aset name=pkg.description value="A package with two values for variant.arch."
2091N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2091N/Aset name=org.opensolaris.consolidation value=osnet
2091N/Aset name=variant.opensolaris.zone value=global value=nonglobal
2091N/Aset name=pkg.fmri value=pkg://opensolaris.org/variant/twovar@0.5.11,5.11-0.148:20100910T211706Z
2091N/Adir group=sys mode=0755 owner=root path=kernel/strmod variant.opensolaris.zone=global
2091N/A"""
2147N/A ref_mf["no_rename-dummy-ancestor.mf"] = """
2147N/A#
2147N/A# This is a dummy package designed trip a lint of no-ancestor-legacy.mf
2147N/A# we don't declare a dependency on the FMRI delivered by it.
2147N/A#
2147N/Aset name=pkg.fmri value=pkg://opensolaris.org/SUNWckr-norename@0.5.11,5.11-0.141
2147N/Aset name=pkg.description value="additional reference actions for pkglint"
2147N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2147N/Aset name=pkg.summary value="Core Solaris Kernel"
2147N/Aset name=org.opensolaris.consolidation value=osnet
2147N/Aset name=variant.arch value=i386 value=sparc
2147N/Adepend fmri=system/kernel type=require
2147N/A"""
2147N/A
2147N/A ref_mf["legacy-uses-renamed-ancestor.mf"] = """
2147N/A#
2147N/A# A package with a legacy action that points to a renamed ancestor
2147N/A#
2147N/Aset name=pkg.fmri value=pkg://opensolaris.org/legacy-uses-renamed-ancestor@0.5.11,5.11-0.141
2147N/Aset name=pkg.description value="additional reference actions for pkglint"
2147N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2147N/Aset name=pkg.summary value="Core Solaris Kernel"
2147N/Aset name=org.opensolaris.consolidation value=osnet
2147N/Aset name=variant.arch value=i386 value=sparc
2147N/Alegacy pkg="renamed-ancestor-old" desc="core kernel software for a specific instruction-set architecture" arch=i386 category=system hotline="Please contact your local service provider" name="Core Solaris Kernel (Root)" vendor="Sun Microsystems, Inc." version=11.11,REV=2009.11.11
2147N/A"""
2147N/A
2147N/A ref_mf["renamed-ancestor-old.mf"] = """
2147N/A#
2147N/A# The ancestor referred to above, but we've renamed it
2147N/A#
2147N/Aset name=pkg.fmri value=pkg://opensolaris.org/renamed-ancestor-old@0.5.11,5.11-0.141
2147N/Aset name=pkg.description value="additional reference actions for pkglint"
2147N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2147N/Aset name=pkg.summary value="Core Solaris Kernel"
2147N/Aset name=org.opensolaris.consolidation value=osnet
2147N/Aset name=variant.arch value=i386 value=sparc
2147N/Aset name=pkg.renamed value=true
2147N/Adepend fmri=renamed-ancestor-new type=require
2147N/A"""
2147N/A ref_mf["renamed-ancestor-new.mf"] = """
2147N/A#
2147N/A# The renamed legacy ancestor - this correctly depends on the latest
2147N/A# named version
2147N/A#
2147N/Aset name=pkg.fmri value=pkg://opensolaris.org/renamed-ancestor-new@0.5.11,5.11-0.141
2147N/Aset name=pkg.description value="additional reference actions for pkglint"
2147N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2147N/Aset name=pkg.summary value="Core Solaris Kernel"
2147N/Aset name=org.opensolaris.consolidation value=osnet
2147N/Aset name=variant.arch value=i386 value=sparc
2147N/Aset name=pkg.renamed value=true
2147N/Adepend fmri=legacy-uses-renamed-ancestor type=require
2147N/A"""
2091N/A
2776N/A ref_mf["compat-renamed-ancestor-old.mf"] = """
2776N/A#
2776N/A# A package with a legacy action that points to a package name that has the
2776N/A# leaf name that matches the 'pkg' attribute of the legacy action that it
2776N/A# delivers. A real-world example of this is the legacy action in
2776N/A# pkg://solaris/compatibility/packages/SUNWbip
2776N/A# and the related packages:
2776N/A# pkg://solaris/network/ftp
2776N/A# pkg://solaris/network/ping
2776N/A# pkg://solaris/SUNWbip
2776N/A
2776N/Aset name=pkg.fmri value=pkg://opensolaris.org/compatibility/renamed-ancestor-old@0.5.11,5.11-0.141
2776N/Aset name=pkg.description value="additional reference actions for pkglint"
2776N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2776N/Aset name=pkg.summary value="Core Solaris Kernel"
2776N/Aset name=org.opensolaris.consolidation value=osnet
2776N/Aset name=variant.arch value=i386 value=sparc
2776N/A# (normally a compatibility package would contain dependencies on the
2776N/A# packages that now deliver content previously delivered by the SVR4 pkg
2776N/A# 'renamed-ancestor-old'. They're not necessary for this test.)
2776N/Alegacy pkg="renamed-ancestor-old" desc="core kernel software for a specific instruction-set architecture" arch=i386 category=system hotline="Please contact your local service provider" name="Core Solaris Kernel (Root)" vendor="Sun Microsystems, Inc." version=11.11,REV=2009.11.11
2776N/A"""
2776N/A
2715N/A ref_mf["depend-possibly-obsolete.mf"] = """
2715N/A#
2715N/A# We declare a dependency on a package that we intend to make obsolete
2715N/A# in the lint repository, though this package itself is perfectly valid.
2715N/A#
2715N/Aset name=pkg.fmri value=pkg://opensolaris.org/dep/tobeobsolete@0.5.11,5.11-0.141
2715N/Aset name=pkg.description value="additional reference actions for pkglint"
2715N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2715N/Aset name=pkg.summary value="Core Solaris Kernel"
2715N/Aset name=org.opensolaris.consolidation value=osnet
2715N/Aset name=variant.arch value=i386 value=sparc
2715N/A# we mark this linted because we know this package does not exist in the
2715N/A# reference repository
2715N/Adepend fmri=system/obsolete-this type=require
2715N/A"""
2715N/A
2046N/A # A set of manifests to be linted. Note that these are all self
2046N/A # consistent, passing all lint checks on their own.
2046N/A # Errors are designed to show up when linted against the ref_*
2046N/A # manifests, as imported to our reference repository.
2046N/A lint_mf = {}
2046N/A expected_failures = {}
2046N/A
2046N/A expected_failures["deliver-old-sample1.mf"] = ["pkglint.dupaction001.1",
2046N/A "pkglint.manifest004"]
2046N/A lint_mf["deliver-old-sample1.mf"] = """
2046N/A#
2046N/A# We deliver something a package older version than our ref_repo has,
2046N/A# 0.140 instead of 0.141, this should cause errors unless we're
2046N/A# linting against the 0.140 build in the repository.
2046N/A# (the errors being, a name clash for system/kernel and a path clash
2046N/A# for etc/passwd - essentially pkglint sees the 0.140 package being a
2046N/A# duplicate of the 0.141 package)
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.140
2081N/Aset name=pkg.description value="core kernel"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Afile /etc/passwd path=etc/passwd group=sys mode=0644 owner=root preserve=true
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/A"""
2046N/A
2046N/A expected_failures["deliver-new-sample1.mf"] = []
2046N/A lint_mf["deliver-new-sample1.mf"] = """
2046N/A#
2046N/A# We deliver a newer version than our reference repo has
2046N/A#
2046N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141
2081N/Aset name=pkg.description value="core kernel"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Afile /etc/passwd path=etc/passwd group=sys mode=0644 owner=root preserve=true
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/A"""
2046N/A
2081N/A expected_failures["deliver-new-sample1-duplicate.mf"] = \
2081N/A ["pkglint.dupaction001.1"]
2046N/A lint_mf["deliver-new-sample1-duplicate.mf"] = """
2046N/A#
2046N/A# We deliver a newer version than our reference repo has, intentionally
2081N/A# duplicating a file our reference repository has in sample3
2046N/A#
2081N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.142
2081N/Aset name=pkg.description value="core kernel"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Afile /etc/passwd path=etc/passwd group=sys mode=0644 owner=root preserve=true
2046N/Afile /etc/group path=etc/group group=sys mode=0644 owner=root preserve=true
2046N/Adir group=sys mode=0755 owner=root path=etc
2046N/A"""
2046N/A
2046N/A expected_failures["no-ancestor-legacy.mf"] = ["pkglint.action003.2"]
2046N/A lint_mf["no-ancestor-legacy.mf"] = \
2046N/A"""
2046N/A#
2046N/A# We deliver a legacy action, but declare a package in the legacy action pkg=
2046N/A# field from the ref repo which doesn't depend on us. Only one failure,
2046N/A# because the 2nd legacy action below points to a non-existent package.
2046N/A#
2081N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141
2081N/Aset name=pkg.description value="core kernel"
2046N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2046N/Aset name=pkg.summary value="Core Solaris Kernel"
2046N/Aset name=variant.arch value=i386 value=sparc
2046N/Aset name=org.opensolaris.consolidation value=osnet
2046N/Alegacy arch=i386 category=system desc="core kernel software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris Kernel (Root)" pkg=SUNWckr variant.arch=i386 vendor="Sun Microsystems, Inc." version=11.11,REV=2009.11.11
2046N/Alegacy arch=sparc category=system desc="core kernel software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris Kernel (Root)" pkg=SUNWthisdoesnotexist variant.arch=sparc vendor="Sun Microsystems, Inc." version=11.11,REV=2009.11.11
2046N/A"""
2046N/A
2081N/A expected_failures["unversioned-dep-obsolete.mf"] = ["pkglint.action005"]
2081N/A lint_mf["unversioned-dep-obsolete.mf"] = """
2081N/A#
2081N/A# We declare a dependency without a version number, on an obsolete package
2081N/A# this should result in a lint error
2081N/A#
2081N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141
2081N/Aset name=pkg.description value="core kernel"
2081N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2081N/Aset name=pkg.summary value="Core Solaris Kernel"
2081N/Aset name=org.opensolaris.consolidation value=osnet
2081N/Aset name=variant.arch value=i386 value=sparc
2081N/Adepend fmri=pkg:/system/obsolete type=require
2081N/A """
2081N/A
2081N/A expected_failures["versioned-dep-obsolete.mf"] = ["pkglint.action005"]
2081N/A lint_mf["versioned-dep-obsolete.mf"] = """
2081N/A#
2081N/A# We declare a dependency on a version known to be obsolete
2081N/A#
2081N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141
2081N/Aset name=pkg.description value="core kernel"
2081N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2081N/Aset name=pkg.summary value="Core Solaris Kernel"
2081N/Aset name=org.opensolaris.consolidation value=osnet
2081N/Aset name=variant.arch value=i386 value=sparc
2081N/Adepend fmri=pkg://opensolaris.org/system/obsolete@0.5.11,5.11-0.141 type=require
2081N/A """
2081N/A
2081N/A expected_failures["versioned-older-obsolete.mf"] = ["pkglint.action005"]
2081N/A lint_mf["versioned-older-obsolete.mf"] = """
2081N/A#
2081N/A# We have dependency on an older version of the packages which was recently
2081N/A# made obsolete. Even though we declared the dependency on the non-obsolete
2081N/A# version, because we published a later, obsoleted version of that package,
2081N/A# we should get the lint warning.
2081N/A#
2081N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/kernel@0.5.11,5.11-0.141
2081N/Aset name=pkg.description value="core kernel"
2081N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2081N/Aset name=pkg.summary value="Core Solaris Kernel"
2081N/Aset name=org.opensolaris.consolidation value=osnet
2081N/Aset name=variant.arch value=i386 value=sparc
2081N/Adepend fmri=system/obsolete@0.5.11-0.140 type=require
2081N/A """
2081N/A
2091N/A expected_failures["onevar.mf"] = []
2091N/A lint_mf["onevar.mf"] = """
2091N/A#
2091N/A# Test that a package which is only published against one variant value doesn't
2091N/A# cause an assertion failure when it shares an action with another package.
2091N/A# In this case, ketnel/strmod is shared between this package and the reference
2091N/A# package twovar.
2091N/A#
2091N/Aset name=pkg.summary value="A package with one variant" variant.arch=i386
2091N/Aset name=org.opensolaris.consolidation value=osnet variant.arch=i386
2091N/Aset name=info.classification value="org.opensolaris.category.2008:Drivers/Other Peripherals" variant.arch=i386
2091N/Aset name=variant.arch value=i386
2091N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2091N/Aset name=pkg.fmri value=pkg://opensolaris.org/variants/onevar@0.5.11,5.11-0.148:20100910T195826Z
2091N/Aset name=pkg.description value="A package published against only one variant value" variant.arch=i386
2091N/Adir group=sys mode=0755 owner=root path=kernel/strmod variant.arch=i386 variant.opensolaris.zone=global
2091N/A"""
2091N/A
2147N/A expected_failures["broken-renamed-ancestor-new.mf"] = \
2147N/A ["pkglint.manifest002.3"]
2147N/A lint_mf["broken-renamed-ancestor-new.mf"] = """
2147N/A#
2147N/A# A new version of one of the packages in the rename chain for
2147N/A# legacy-has-renamed-ancestor, which should result in an error.
2147N/A# When tested on its own, this package results in just the 'missing rename'
2147N/A# error, pkglint.manifest002.3 When tested as part of a checking a legacy
2147N/A# action which has a pkg attribute pointing to an old package that gets renamed,
2147N/A# we should get pkglint.action003.4
2147N/A#
2147N/Aset name=pkg.fmri value=pkg://opensolaris.org/renamed-ancestor-new@0.5.11,5.11-0.141
2147N/Aset name=pkg.description value="additional reference actions for pkglint"
2147N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2147N/Aset name=pkg.summary value="Core Solaris Kernel"
2147N/Aset name=org.opensolaris.consolidation value=osnet
2147N/Aset name=variant.arch value=i386 value=sparc
2147N/Aset name=pkg.renamed value=true
2147N/Adepend fmri=renamed-ancestor-missing type=require
2147N/A"""
2147N/A
2147N/A expected_failures["self-depend-renamed-ancestor-new.mf"] = ["pkglint.manifest002.4"]
2147N/A lint_mf["self-depend-renamed-ancestor-new.mf"] = """
2147N/A#
2147N/A# A new version of one of the packages in the rename chain for
2147N/A# legacy-has-renamed-ancestor, which should result in an error.
2147N/A# When tested on its own, this package results in the 'looping rename'
2147N/A# error, pkglint.manifest002.4 When tested as part of a checking a legacy action
2147N/A# which has a pkg attribute point to an old package that gets renamed,
2147N/A# we should get pkglint.action003.5, since we're trying to depend on ourselves
2147N/A#
2147N/Aset name=pkg.fmri value=pkg://opensolaris.org/renamed-ancestor-new@0.5.11,5.11-0.141
2147N/Aset name=pkg.description value="additional reference actions for pkglint"
2147N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2147N/Aset name=pkg.summary value="Core Solaris Kernel"
2147N/Aset name=org.opensolaris.consolidation value=osnet
2147N/Aset name=variant.arch value=i386 value=sparc
2147N/Aset name=pkg.renamed value=true
2147N/Adepend fmri=renamed-ancestor-new type=require
2147N/A"""
2147N/A
2715N/A expected_failures["renamed-obsolete.mf"] = ["pkglint.manifest002.5"]
2715N/A lint_mf["renamed-obsolete.mf"] = """
2715N/A#
2715N/A# We try to rename ourselves to an obsolete package.
2715N/A#
2715N/Aset name=pkg.fmri value=pkg://opensolaris.org/an-old-name@0.5.11,5.11-0.141
2715N/Aset name=pkg.description value="additional reference actions for pkglint"
2715N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2715N/Aset name=pkg.summary value="Core Solaris Kernel"
2715N/Aset name=org.opensolaris.consolidation value=osnet
2715N/Aset name=variant.arch value=i386 value=sparc
2715N/Aset name=pkg.renamed value=true
2715N/Adepend fmri=system/obsolete type=require
2715N/A"""
2715N/A
2715N/A expected_failures["obsolete-this.mf"] = ["pkglint.manifest001.3"]
2715N/A lint_mf["obsolete-this.mf"] = """
2715N/A#
2715N/A# Make this package obsolete. Since it has a dependency in the ref_repository,
2715N/A# we should get a warning, but only when linting against that repo.
2715N/A#
2715N/Aset name=pkg.fmri value=pkg://opensolaris.org/system/obsolete-this@0.5.11,5.11-0.141
2715N/Aset name=pkg.obsolete value=true variant.arch=i386
2715N/Aset name=variant.opensolaris.zone value=global value=nonglobal variant.arch=i386
2715N/Aset name=variant.arch value=i386
2715N/A"""
2715N/A
2290N/A lint_move_mf = {}
2290N/A lint_move_mf["move-sample1.mf"] = """
2290N/A#
2290N/A# A sample package which delivers several actions, to 0.161. We no longer
2290N/A# deliver etc/passwd, moving that to the package in move-sample2.mf below.
2290N/A#
2290N/Aset name=pkg.fmri value=pkg://foo.org/system/kernel@0.5.11,5.11-0.161
2290N/Aset name=pkg.description value="we remove etc/passwd from this package"
2290N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2290N/Aset name=pkg.summary value="Core Solaris Kernel"
2290N/Aset name=org.opensolaris.consolidation value=osnet
2290N/Aset name=variant.arch value=i386 value=sparc
2290N/Adir group=sys mode=0755 owner=root path=etc
2290N/A"""
2290N/A
2290N/A lint_move_mf["move-sample2.mf"] = """
2290N/A#
2290N/A# A sample package which delivers several actions, we now deliver etc/passwd
2290N/A# also.
2290N/A#
2290N/Aset name=pkg.fmri value=pkg://foo.org/system/additional@0.5.11,5.11-0.161
2290N/Aset name=pkg.description value="this manifest now gets etc/passwd too"
2290N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2290N/Aset name=pkg.summary value="additional content"
2290N/Aset name=org.opensolaris.consolidation value=osnet
2290N/Aset name=variant.arch value=i386 value=sparc
2290N/Afile /etc/motd group=sys mode=0644 owner=root path=etc/motd
2290N/Afile /etc/passwd path=etc/passwd group=sys mode=0644 owner=root preserve=true
2290N/Adir group=sys mode=0755 owner=root path=etc
2290N/Adir group=sys mode=0755 owner=root path=etc
2290N/A"""
2290N/A
2046N/A def setUp(self):
2046N/A
2046N/A pkg5unittest.ManyDepotTestCase.setUp(self,
2046N/A ["opensolaris.org", "opensolaris.org", "opensolaris.org"],
2046N/A start_depots=True)
2046N/A
2046N/A self.ref_uri = self.dcs[1].get_depot_url()
2046N/A self.lint_uri = self.dcs[2].get_depot_url()
2046N/A self.empty_lint_uri = self.dcs[3].get_depot_url()
2046N/A self.cache_dir = tempfile.mkdtemp("pkglint-cache", "",
2046N/A self.test_root)
2046N/A
2046N/A paths = self.make_misc_files(self.ref_mf)
2046N/A
2046N/A for item in paths:
2046N/A self.pkgsend(depot_url=self.ref_uri,
3158N/A command="publish {0}".format(item))
2046N/A self.pkgsend(depot_url=self.ref_uri,
2046N/A command="refresh-index")
2046N/A
2046N/A paths = self.make_misc_files(self.lint_mf)
2046N/A for item in paths:
2081N/A self.pkgsend(depot_url=self.lint_uri,
3158N/A command="publish {0}".format(item))
2081N/A self.pkgsend(depot_url=self.lint_uri,
2046N/A command="refresh-index")
2328N/A # we should sign the repositories for additional coverage
2405N/A self.pkgsign(self.lint_uri, "'*'")
2405N/A self.pkgsign(self.ref_uri, "'*'")
2046N/A
2046N/A def test_lint_repo_basics(self):
2046N/A """Test basic handling of repo URIs with the lint engine,
2046N/A reference repo is error free, cache dir torn down appropriately.
2046N/A """
2046N/A if not os.path.exists(self.cache_dir):
2046N/A os.makedirs(self.cache_dir)
2046N/A
2046N/A lint_logger = TestLogFormatter()
2081N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2085N/A config_file=os.path.join(self.test_root, "pkglintrc"))
2046N/A
2046N/A lint_engine.setup(cache=self.cache_dir,
2046N/A lint_uris=[self.ref_uri])
2046N/A lint_engine.execute()
2046N/A
2715N/A lint_msgs = []
2715N/A # prune out the missing dependency warnings
2715N/A for msg in lint_logger.messages:
2715N/A if "pkglint.action005.1" not in msg:
2715N/A lint_msgs.append(msg)
2715N/A
3339N/A self.assertTrue(len(lint_msgs) == 0,
2046N/A "Unexpected lint errors messages reported against "
3158N/A "reference repo: {0}".format(
3158N/A "\n".join(lint_msgs)))
2046N/A lint_logger.close()
2046N/A
2046N/A lint_engine.teardown()
3339N/A self.assertTrue(os.path.exists(self.cache_dir),
2046N/A "Cache dir does not exist after teardown!")
3339N/A self.assertTrue(os.path.exists(
2046N/A os.path.join(self.cache_dir, "lint_image")),
2046N/A "lint image dir still existed after teardown!")
2046N/A
2046N/A # This shouldn't appear when we're not using a reference repo
2046N/A self.assertFalse(os.path.exists(
2046N/A os.path.join(self.cache_dir, "ref_image")),
2046N/A "ref image dir existed!")
2046N/A lint_engine.teardown(clear_cache=True)
2046N/A self.assertFalse(os.path.exists(self.cache_dir),
2046N/A "Cache dir was not torn down as expected")
2046N/A
2046N/A def test_empty_lint_repo(self):
2046N/A """Ensure we can lint an empty repository"""
2046N/A
2046N/A paths = self.make_misc_files(self.lint_mf)
2046N/A if not os.path.exists(self.cache_dir):
2046N/A os.makedirs(self.cache_dir)
2046N/A
2046N/A lint_logger = TestLogFormatter()
2081N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2085N/A config_file=os.path.join(self.test_root, "pkglintrc"))
2046N/A
2046N/A lint_engine.setup(cache=self.cache_dir,
2046N/A lint_uris=[self.ref_uri])
2046N/A lint_engine.execute()
2046N/A
2081N/A lint_msgs = []
2081N/A # prune out the missing dependency warnings
2081N/A for msg in lint_logger.messages:
2081N/A if "pkglint.action005.1" not in msg:
2081N/A lint_msgs.append(msg)
2081N/A
2081N/A self.assertFalse(lint_msgs,
2046N/A "Lint messages reported from a clean reference repository.")
2046N/A lint_engine.teardown(clear_cache=True)
2046N/A
2046N/A # this should be an empty test: we have no packages in the
2046N/A # lint repository, so we end up doing nothing
2046N/A lint_logger = TestLogFormatter()
2046N/A lint_engine.setup(cache=self.cache_dir,
2046N/A lint_uris=[self.empty_lint_uri])
2046N/A lint_engine.execute()
2046N/A lint_engine.teardown(clear_cache=True)
2046N/A self.assertFalse(lint_logger.messages,
2046N/A "Lint messages reported from a empty lint repository.")
2046N/A
2046N/A def test_versioning(self):
2046N/A """Package version handling during lint runs.
2046N/A In particular, it verifies that packages for linting are merged
2046N/A correctly into pkglint's view of what the ref repository would
2046N/A look like, were the lint package to be published to the
2046N/A reference repository."""
2046N/A
2046N/A paths = self.make_misc_files(self.lint_mf)
2046N/A paths.sort()
2046N/A
2046N/A for manifest in paths:
3158N/A self.debug("running lint checks on {0}".format(manifest))
2046N/A basename = os.path.basename(manifest)
2046N/A lint_logger = TestLogFormatter()
2046N/A lint_engine = engine.LintEngine(lint_logger,
2085N/A use_tracker=False,
2085N/A config_file=os.path.join(self.test_root,
2085N/A "pkglintrc"))
2046N/A
2046N/A manifests = read_manifests([manifest], lint_logger)
2046N/A lint_engine.setup(cache=self.cache_dir,
2046N/A ref_uris=[self.ref_uri],
2046N/A lint_manifests=manifests)
2046N/A
2046N/A lint_engine.execute()
2046N/A lint_engine.teardown(clear_cache=True)
2046N/A
2046N/A expected = len(self.expected_failures[basename])
2046N/A actual = len(lint_logger.messages)
2046N/A if (actual != expected):
2046N/A self.debug("\n".join(lint_logger.messages))
3339N/A self.assertTrue(actual == expected,
3158N/A "Expected {0} failures for {1}, got {2}: {3}".format(
3158N/A expected, basename, actual,
2046N/A "\n".join(lint_logger.messages)))
2046N/A else:
2046N/A reported = lint_logger.ids
2046N/A known = self.expected_failures[basename]
2046N/A reported.sort()
2046N/A known.sort()
2046N/A for i in range(0, len(reported)):
3339N/A self.assertTrue(reported[i] == known[i],
2081N/A "Differences in reported vs. expected"
3158N/A " lint ids for {0}: {1} vs. {2}".format(
3158N/A basename, str(reported),
2046N/A str(known)))
2046N/A lint_logger.close()
2046N/A
2046N/A # this manifest should report duplicates when
2046N/A # linted against a 0.141 repository, but none
2046N/A # when linted against a 0.140 repository. The duplicates
2046N/A # were tested when 'deliver-old-sample1.mf' was linted
2046N/A # above - this time, we lint against 0.140 and expect
2046N/A # no errors.
2046N/A lint_logger = TestLogFormatter()
2081N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2085N/A config_file=os.path.join(self.test_root, "pkglintrc"))
2046N/A
2046N/A path = os.path.join(self.test_root, "deliver-old-sample1.mf")
2046N/A manifests = read_manifests([path], lint_logger)
2046N/A
2046N/A lint_engine.setup(cache=self.cache_dir,
2046N/A ref_uris=[self.ref_uri],
2046N/A lint_manifests=manifests, release="140")
2046N/A lint_engine.execute()
2046N/A lint_engine.teardown(clear_cache=True)
2046N/A
2046N/A self.assertFalse(lint_logger.messages,
2046N/A "Unexpected lint messages when linting against old "
3158N/A "version of reference repo: {0}".format(
3158N/A "\n".join(lint_logger.messages)))
2046N/A
2046N/A # ensure we detect the error when linting against the reference
2046N/A # 0.139 repository
2046N/A lint_logger = TestLogFormatter()
2081N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2085N/A config_file=os.path.join(self.test_root, "pkglintrc"))
2046N/A lint_engine.setup(cache=self.cache_dir,
2046N/A ref_uris=[self.ref_uri],
2046N/A lint_uris=[self.ref_uri], release="139")
2046N/A lint_engine.execute()
2046N/A lint_engine.teardown(clear_cache=True)
2046N/A
2046N/A if not lint_logger.ids:
3339N/A self.assertTrue(False,
2046N/A "No lint messages produced when linting the "
2046N/A "contents of an old repository")
2046N/A elif len(lint_logger.ids) != 1:
3339N/A self.assertTrue(False,
2046N/A "Expected exactly 1 lint message when linting the "
3158N/A "contents of an old repository, got {0}".format(
3158N/A len(lint_logger.ids)))
2046N/A elif lint_logger.ids[0] != "pkglint.dupaction001.1":
3339N/A self.assertTrue(False,
2046N/A "Expected pkglint.dupaction001.1 message when "
2046N/A "linting the contents of an old repository, got "
3158N/A "{0}".format(lint_logger.ids[0]))
2046N/A
2046N/A
2046N/A def test_lint_mf_baseline(self):
2046N/A """The lint manifests in this test class should be lint-clean
2046N/A themselves - they should only report errors when linting against
2046N/A our reference repository."""
2046N/A
2046N/A paths = self.make_misc_files(self.lint_mf)
2046N/A paths.sort()
2046N/A
2046N/A for manifest in paths:
2046N/A basename = os.path.basename(manifest)
2046N/A lint_logger = TestLogFormatter()
2046N/A lint_engine = engine.LintEngine(lint_logger,
2085N/A use_tracker=False,
2085N/A config_file=os.path.join(self.test_root,
2085N/A "pkglintrc"))
2046N/A
2046N/A manifests = read_manifests([manifest], lint_logger)
2046N/A lint_engine.setup(lint_manifests=manifests)
2046N/A
2046N/A lint_engine.execute()
2046N/A lint_engine.teardown()
2081N/A
2147N/A # prune missing dependency and missing rename warnings
2081N/A lint_msgs = []
2081N/A for msg in lint_logger.messages:
2147N/A if "pkglint.manifest002.3" in msg or \
2147N/A "pkglint.manifest002.4" in msg or \
2147N/A "pkglint.action005.1" in msg:
2147N/A pass
2147N/A else:
2081N/A lint_msgs.append(msg)
2081N/A
2081N/A self.assertFalse(lint_msgs,
2046N/A "Unexpected lint messages when linting individual "
3158N/A "manifests that should contain no errors: {0} {1}".format(
3158N/A basename, "\n".join(lint_msgs)))
2046N/A
2147N/A def test_broken_legacy_rename(self):
2147N/A """Tests that linting a package where we break the renaming
2147N/A of a legacy package, we'll get an error."""
2147N/A
2147N/A paths = self.make_misc_files(self.lint_mf)
2147N/A paths.extend(self.make_misc_files(self.ref_mf))
2147N/A rcfile = os.path.join(self.test_root, "pkglintrc")
2147N/A
2147N/A legacy = os.path.join(self.test_root,
2147N/A "legacy-uses-renamed-ancestor.mf")
2147N/A renamed_new = os.path.join(self.test_root,
2147N/A "broken-renamed-ancestor-new.mf")
2776N/A renamed_old = os.path.join(self.test_root,
2776N/A "renamed-ancestor-old.mf")
2147N/A renamed_self_depend = os.path.join(self.test_root,
2147N/A "self-depend-renamed-ancestor-new.mf")
2776N/A compat_legacy = os.path.join(self.test_root,
2776N/A "compat-renamed-ancestor-old.mf")
2147N/A
2147N/A # look for a rename that didn't ultimately resolve to the
2147N/A # package that contained the legacy action
2147N/A lint_logger = TestLogFormatter()
2147N/A manifests = read_manifests([legacy, renamed_new], lint_logger)
2147N/A
2147N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2147N/A config_file=rcfile)
2147N/A lint_engine.setup(cache=self.cache_dir,
2147N/A ref_uris=[self.ref_uri], lint_manifests=manifests)
2147N/A lint_engine.execute()
2147N/A lint_engine.teardown(clear_cache=True)
2147N/A
2147N/A lint_msgs = []
2147N/A for msg in lint_logger.messages:
2147N/A if "pkglint.action005.1" not in msg:
2147N/A lint_msgs.append(msg)
2147N/A
3339N/A self.assertTrue(len(lint_msgs) == 2, "Unexpected lint messages "
3158N/A "{0} produced when linting broken renaming with legacy "
3158N/A "pkgs".format(lint_msgs))
2147N/A
2147N/A seen_2_3 = False
2147N/A seen_3_4 = False
2147N/A for i in lint_logger.ids:
2147N/A if i == "pkglint.manifest002.3":
2147N/A seen_2_3 = True
2147N/A if i == "pkglint.action003.4":
2147N/A seen_3_4 = True
2147N/A
3339N/A self.assertTrue(seen_2_3 and seen_3_4,
2147N/A "Missing expected broken renaming legacy errors, "
3158N/A "got {0}".format(lint_msgs))
2147N/A
2147N/A # make sure we spot renames that depend upon themselves
2147N/A lint_logger = TestLogFormatter()
2147N/A manifests = read_manifests([legacy, renamed_self_depend],
2147N/A lint_logger)
2147N/A
2147N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2147N/A config_file=rcfile)
2147N/A lint_engine.setup(cache=self.cache_dir,
2147N/A ref_uris=[self.ref_uri], lint_manifests=manifests)
2147N/A lint_engine.execute()
2147N/A lint_engine.teardown(clear_cache=True)
2147N/A
2147N/A lint_msgs = []
2147N/A for msg in lint_logger.messages:
2147N/A lint_msgs.append(msg)
2147N/A
3339N/A self.assertTrue(len(lint_msgs) == 2, "Unexpected lint messages "
2147N/A "produced when linting broken self-dependent renaming with "
2147N/A "legacy pkgs")
2147N/A seen_2_4 = False
2147N/A seen_3_5 = False
2147N/A for i in lint_logger.ids:
2147N/A if i == "pkglint.manifest002.4":
2147N/A seen_2_4 = True
2147N/A if i == "pkglint.action003.5":
2147N/A seen_3_5 = True
3339N/A self.assertTrue(seen_2_3 and seen_3_4,
2147N/A "Missing expected broken renaming self-dependent errors "
3158N/A "with legacy pkgs. Got {0}".format(lint_msgs))
2147N/A
2776N/A # make sure we can deal with compatibility packages. We include
2776N/A # the 'renamed_old' package as well as the 'compat_legacy'
2776N/A # to ensure that pkglint is satisfied by the compatability
2776N/A # package, rather that trying to follow renames from the
2776N/A # 'renamed_old' package. (otherwise, if a package pointed to by
2776N/A # the legacy 'pkg' attribute doesn't exist, pkglint wouldn't
2776N/A # complain)
2776N/A lint_logger = TestLogFormatter()
2776N/A manifests = read_manifests([renamed_old, compat_legacy],
2776N/A lint_logger)
2776N/A
2776N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2776N/A config_file=rcfile)
2776N/A lint_engine.setup(cache=self.cache_dir,
2776N/A ref_uris=[self.ref_uri], lint_manifests=manifests)
2776N/A lint_engine.execute()
2776N/A lint_engine.teardown(clear_cache=True)
2776N/A
2776N/A lint_msgs = []
2776N/A for msg in lint_logger.messages:
2776N/A lint_msgs.append(msg)
2776N/A
2776N/A self.debug(lint_msgs)
3339N/A self.assertTrue(len(lint_msgs) == 0, "Unexpected lint messages "
2776N/A "produced when linting a compatibility legacy package")
2776N/A
2776N/A # the 'legacy' package includes a legacy action which should
2776N/A # also be satisfied by the compat_legacy being installed.
2776N/A lint_logger = TestLogFormatter()
2776N/A manifests = read_manifests([legacy, compat_legacy],
2776N/A lint_logger)
2776N/A
2776N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2776N/A config_file=rcfile)
2776N/A lint_engine.setup(cache=self.cache_dir,
2776N/A ref_uris=[self.ref_uri], lint_manifests=manifests)
2776N/A lint_engine.execute()
2776N/A lint_engine.teardown(clear_cache=True)
2776N/A
2776N/A lint_msgs = []
2776N/A for msg in lint_logger.messages:
2776N/A lint_msgs.append(msg)
2776N/A
3339N/A self.assertTrue(len(lint_msgs) == 0, "Unexpected lint messages "
2776N/A "produced when linting a compatibility legacy package")
2776N/A
2090N/A def test_relative_path(self):
2090N/A """The engine can start with a relative path to its cache."""
2090N/A lint_logger = TestLogFormatter()
2090N/A lint_engine = engine.LintEngine(lint_logger,
2090N/A use_tracker=False,
2090N/A config_file=os.path.join(self.test_root,
2090N/A "pkglintrc"))
2090N/A
2090N/A lint_engine.setup(cache=self.cache_dir,
2090N/A lint_uris=[self.ref_uri])
2090N/A
2090N/A lint_engine.execute()
2090N/A lint_engine.teardown()
2090N/A
2090N/A relative = os.path.join("..", os.path.basename(self.cache_dir))
2090N/A cache = os.path.join(self.cache_dir, relative)
2090N/A lint_engine.setup(cache=cache)
2090N/A lint_engine.execute()
2090N/A lint_engine.teardown(clear_cache=True)
2090N/A
2290N/A def test_ref_file_move(self):
2290N/A """The dupaction checks can cope with a file that moves between
2290N/A packages, where the old package was delivered in our reference
2290N/A repository and we're linting both new packages: the package
2290N/A from which the file was moved, as well as the package to which
2290N/A the file is moving.
2290N/A
2290N/A It should report an error when we only lint the new version
2290N/A of the package to which the file is moving, but not the new
2290N/A version of package from which the file was moved."""
2290N/A
2290N/A paths = self.make_misc_files(self.lint_move_mf)
2290N/A paths.sort()
2290N/A rcfile = os.path.join(self.test_root, "pkglintrc")
2290N/A
2290N/A move_src = os.path.join(self.test_root, "move-sample1.mf")
2290N/A move_dst = os.path.join(self.test_root, "move-sample2.mf")
2290N/A
2290N/A lint_logger = TestLogFormatter()
2290N/A
2290N/A # first check that file moves work properly, that is,
2290N/A # we should report no errors here.
2290N/A manifests = read_manifests([move_src, move_dst], lint_logger)
2290N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2290N/A config_file=rcfile)
2290N/A lint_engine.setup(cache=self.cache_dir,
2290N/A ref_uris=[self.ref_uri], lint_manifests=manifests)
2290N/A lint_engine.execute()
2290N/A lint_engine.teardown(clear_cache=True)
2290N/A
2290N/A lint_msgs = []
2290N/A for msg in lint_logger.messages:
2290N/A lint_msgs.append(msg)
2290N/A
3339N/A self.assertTrue(lint_msgs == [], "Unexpected errors during file "
3158N/A "movement between packages: {0}".format("\n".join(lint_msgs)))
2290N/A
2290N/A # next check that when delivering only the moved-to package,
2290N/A # we report a duplicate error.
2290N/A manifests = read_manifests([move_dst], lint_logger)
2290N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2290N/A config_file=rcfile)
2290N/A lint_engine.setup(cache=self.cache_dir,
2290N/A ref_uris=[self.ref_uri], lint_manifests=manifests)
2290N/A lint_engine.execute()
2290N/A lint_engine.teardown(clear_cache=True)
2290N/A
2290N/A lint_msgs = []
2290N/A for msg in lint_logger.messages:
2290N/A lint_msgs.append(msg)
2290N/A
3339N/A self.assertTrue(len(lint_msgs) == 1, "Expected duplicate path "
2290N/A "error not seen when moving file between packages, but "
3158N/A "omitting new source package: {0}".format("\n".join(lint_msgs)))
3339N/A self.assertTrue(lint_logger.ids[0] == "pkglint.dupaction001.1",
3158N/A "Expected pkglint.dupaction001.1, got {0}".format(
3158N/A lint_logger.ids[0]))
2147N/A
2838N/A
2838N/Aclass TestVolatileLintEngineDepot(pkg5unittest.ManyDepotTestCase):
2838N/A """Tests that exercise reference vs. lint repository checks and tests
2838N/A linting of multiple packages at once, similar to TestLintEngineDepot,
2838N/A but with less overhead during setUp (this test class is not marked
2838N/A as persistent_setup = True, so test methods are responsible for their
2838N/A own setup)"""
2838N/A
2838N/A # used by test_get_manifest(..)
2838N/A get_manifest_data = {}
2838N/A# The following two manifests check that given a package in the lint repository,
2838N/A# that we can access the latest version of that package from the reference
2838N/A# repository using LintEngine.get_manifest(.., reference=True)
2838N/A get_manifest_data["get-manifest-ref.mf"] = """
2838N/Aset name=pkg.fmri value=pkg://opensolaris.org/check/parent@0.5.11,5.11-0.100:20100603T215050Z
2838N/Aset name=variant.arch value=i386 value=sparc
2838N/Aset name=pkg.summary value="additional content"
2838N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2838N/Aset name=org.opensolaris.consolidation value=osnet
2838N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2838N/A"""
2838N/A get_manifest_data["get-manifest-oldref.mf"] = """
2838N/Aset name=pkg.fmri value=pkg://opensolaris.org/check/parent@0.5.11,5.11-0.99:20100603T215050Z
2838N/Aset name=variant.arch value=i386 value=sparc
2838N/Aset name=pkg.summary value="additional content"
2838N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2838N/Aset name=org.opensolaris.consolidation value=osnet
2838N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2838N/A"""
2838N/A get_manifest_data["get-manifest-lint.mf"] = """
2838N/A#
2838N/A# This is the manifest that should appear in the lint repository.
2838N/A#
2838N/Aset name=variant.arch value=i386 value=sparc
2838N/Aset name=pkg.summary value="additional content"
2838N/Aset name=pkg.fmri value=pkg://opensolaris.org/check/parent@0.5.11,5.11-0.145:20100603T215050Z
2838N/Aset name=pkg.description value="core kernel software for a specific instruction-set architecture"
2838N/Aset name=org.opensolaris.consolidation value=osnet
2838N/Aset name=info.classification value=org.opensolaris.category.2008:System/Core
2838N/A"""
2838N/A
2838N/A def setUp(self):
2838N/A pkg5unittest.ManyDepotTestCase.setUp(self,
2838N/A ["opensolaris.org", "opensolaris.org"],
2838N/A start_depots=True)
2838N/A
2838N/A self.ref_uri = self.dcs[1].get_depot_url()
2838N/A self.lint_uri = self.dcs[2].get_depot_url()
2838N/A self.cache_dir = tempfile.mkdtemp("pkglint-cache", "",
2838N/A self.test_root)
2838N/A
2838N/A def test_get_manifest(self):
2838N/A """Check that <LintEngine>.get_manifest works ensuring
2838N/A it returns appropriate manifests for the lint and reference
2838N/A repositories."""
2838N/A
2838N/A paths = self.make_misc_files(self.get_manifest_data)
2838N/A rcfile = os.path.join(self.test_root, "pkglintrc")
2838N/A lint_mf = os.path.join(self.test_root, "get-manifest-lint.mf")
2838N/A old_ref_mf = os.path.join(self.test_root,
2838N/A "get-manifest-oldref.mf")
2838N/A ref_mf = os.path.join(self.test_root, "get-manifest-ref.mf")
3158N/A ret, ref_fmri = self.pkgsend(self.ref_uri, "publish {0}".format(
3158N/A ref_mf))
3158N/A ret, oldref_fmri = self.pkgsend(self.ref_uri, "publish {0}".format(
3158N/A old_ref_mf))
3158N/A ret, lint_fmri = self.pkgsend(self.lint_uri, "publish {0}".format(
3158N/A lint_mf))
2838N/A
2838N/A lint_logger = TestLogFormatter()
2838N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2838N/A config_file=rcfile)
2838N/A manifests = read_manifests([lint_mf], lint_logger)
2838N/A lint_engine.setup(cache=self.cache_dir,
2838N/A ref_uris=[self.ref_uri], lint_uris=[self.lint_uri])
2838N/A
2838N/A # try retrieving a few names that should match our lint manifest
2838N/A for name in ["check/parent", "pkg:/check/parent",
2838N/A "pkg://opensolaris.org/check/parent@0.5.10"]:
2838N/A mf = lint_engine.get_manifest(
2838N/A name, search_type=lint_engine.LATEST_SUCCESSOR)
3339N/A self.assertTrue(str(mf.fmri) == lint_fmri)
2838N/A
2838N/A # try retrieving a few names that should match our parent
2838N/A # manifest when using LATEST_SUCCESSOR mode
2838N/A for name in ["check/parent", "pkg:/check/parent",
2838N/A "pkg://opensolaris.org/check/parent@0.5.10"]:
2838N/A mf = lint_engine.get_manifest(
2838N/A name, search_type=lint_engine.LATEST_SUCCESSOR,
2838N/A reference=True)
3339N/A self.assertTrue(str(mf.fmri) == ref_fmri)
2838N/A
2838N/A # try retrieving a few names that should not match when using
2838N/A # EXACT mode.
2838N/A for name in ["check/parent@1.0",
2838N/A "pkg://opensolaris.org/check/parent@0.5.10"]:
2838N/A mf = lint_engine.get_manifest(
2838N/A name, search_type=lint_engine.EXACT)
3339N/A self.assertTrue(mf == None)
2838N/A
2838N/A # try retrieving a specific version of the manifest from the
2838N/A # reference repository.
2838N/A mf = lint_engine.get_manifest(
2838N/A "pkg://opensolaris.org/check/parent@0.5.11,5.11-0.99",
2838N/A search_type=lint_engine.EXACT, reference=True)
3339N/A self.assertTrue(str(mf.fmri) == oldref_fmri)
2838N/A
2838N/A # test that we raise an exception when no reference repo is
2838N/A # configured, but that searches for a non-existent package from
2838N/A # the lint manifests do still return None.
2838N/A shutil.rmtree(os.path.join(self.cache_dir, "ref_image"))
2838N/A lint_engine = engine.LintEngine(lint_logger, use_tracker=False,
2838N/A config_file=rcfile)
2838N/A lint_engine.setup(cache=self.cache_dir,
2838N/A lint_manifests=manifests)
2838N/A mf = lint_engine.get_manifest("example/package")
3339N/A self.assertTrue(mf == None)
2838N/A self.assertRaises(base.LintException, lint_engine.get_manifest,
2838N/A "example/package", reference=True)
2838N/A
2838N/A
2147N/Aclass TestLintEngineInternals(pkg5unittest.Pkg5TestCase):
2147N/A
2147N/A def test_lint_fmri_successor(self):
2147N/A """lint_fmri_successor reports lint successors correctly.
2147N/A
2147N/A The lint fmri_successor check has a biase for new FMRIs and
2147N/A acts differently to the pkg.fmri.PkgFmri is_successor check,
2147N/A favouring the new fmri if it is missing information not present
2147N/A in the old fmri.
2147N/A
2147N/A We also include some tests for the standard is_successor
2147N/A check, which is used in the implementation of
2147N/A lint_fmri_successor."""
2147N/A
2147N/A class FmriPair():
2147N/A def __init__(self, new, old):
2147N/A self.new = new
2147N/A self.old = old
2147N/A
2147N/A def __repr__(self):
3158N/A return "FmriPair({0}, {1}) ".format(self.new, self.old)
2147N/A
2147N/A def is_successor(pair):
2147N/A """baseline the standard fmri.is_successor check"""
2147N/A new = fmri.PkgFmri(pair.new)
2147N/A old = fmri.PkgFmri(pair.old)
2147N/A return new.is_successor(old)
2147N/A
2147N/A def commutative(pair, ignore_pubs=True):
2147N/A """test that new succeeds old and old succeeds new."""
2147N/A new = fmri.PkgFmri(pair.new)
2147N/A old = fmri.PkgFmri(pair.old)
2147N/A return lint_fmri_successor(new, old,
2147N/A ignore_pubs=ignore_pubs) and \
2147N/A lint_fmri_successor(old, new, ignore_pubs=ignore_pubs)
2147N/A
2147N/A def newer(pair, ignore_pubs=True, ignore_timestamps=True):
2147N/A """test that new succeeds old, but old does not succeed new"""
2147N/A new = fmri.PkgFmri(pair.new)
2147N/A old = fmri.PkgFmri(pair.old)
2147N/A return lint_fmri_successor(new, old,
2147N/A ignore_pubs=ignore_pubs,
2147N/A ignore_timestamps=ignore_timestamps) and \
2147N/A not lint_fmri_successor(old, new,
2147N/A ignore_pubs=ignore_pubs,
2147N/A ignore_timestamps=ignore_timestamps)
2147N/A
2147N/A # messages used in assertions
3158N/A fail_msg = "{0} do not pass {1} check"
3158N/A fail_msg_pubs = "{0} do not pass {1} check, ignoring publishers"
3158N/A fail_msg_ts = "{0} do not pass {1} check, ignoring timestamps"
3158N/A
3158N/A fail_comm = fail_msg.format("{0}", "commutative")
3158N/A fail_comm_pubs = fail_msg_pubs.format("{0}", "commutative")
3158N/A fail_newer = fail_msg.format("{0}", "newer")
3158N/A fail_newer_pubs = fail_msg_pubs.format("{0}", "newer")
3158N/A fail_newer_ts = fail_msg_ts.format("{0}", "newer timestamp-sensitive")
3158N/A fail_successor = fail_msg.format("{0}", "is_successor")
2147N/A
2147N/A # 1 identical everything
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.120:20101003T222523Z",
2147N/A "pkg://foo.org/tst@1.0,5.11-0.120:20101003T222523Z")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # 2 identical versions
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.120",
2147N/A "pkg://foo.org/tst@1.0,5.11-0.120")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A
2147N/A # 3 identical names
2147N/A pair = FmriPair("pkg://foo.org/tst",
2147N/A "pkg://foo.org/tst")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A
2147N/A # 4 differing timestamps, same version (identical, in pkglint's view)
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.120:20101003T222523Z",
2147N/A "pkg://foo.org/tst@1.0,5.11-0.120:20311003T222559Z")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
3339N/A self.assertTrue(not is_successor(pair), fail_successor.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_timestamps=False),
3158N/A fail_newer_ts.format(pair))
2147N/A
2147N/A # 5 missing timestamps, same version
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.120",
2147N/A "pkg://foo.org/tst@1.0,5.11-0.120:20101003T222523Z")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
2147N/A
2147N/A # 6 missing timestamps, different version
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.121",
2147N/A "pkg://foo.org/tst@1.0,5.11-0.120:20101003T222523Z")
3339N/A self.assertTrue(newer(pair), fail_newer.format(pair))
3339N/A self.assertTrue(newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
2147N/A
2147N/A # 7 different versions
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.121:20101003T222523Z",
2147N/A "pkg://foo.org/tst@1.0,5.11-0.120:20101003T222523Z")
3339N/A self.assertTrue(newer(pair), fail_newer.format(pair))
3339N/A self.assertTrue(newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
2147N/A
2147N/A # 8 different versions (where string comparisons won't work since
2147N/A # with string comparisons, '0.133' < '0.99' which is not desired
2147N/A pair = FmriPair("pkg://opensolaris.org/SUNWfcsm@0.5.11,5.11-0.133:20100216T065435Z",
2147N/A "pkg://opensolaris.org/SUNWfcsm@0.5.11,5.11-0.99:20100216T065435Z")
3339N/A self.assertTrue(newer(pair), fail_newer.format(pair))
3339N/A self.assertTrue(newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
2147N/A
2147N/A # Now the same set of tests, this time with different publishers
2147N/A # 1.1 identical everything
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.120:20101003T222523Z",
2147N/A "pkg://bar.org/tst@1.0,5.11-0.120:20101003T222523Z")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # 2.1 identical versions
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.120",
2147N/A "pkg://bar.org/tst@1.0,5.11-0.120")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(not commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # 3.1 identical names
2147N/A pair = FmriPair("pkg://foo.org/tst",
2147N/A "pkg://bar.org/tst")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(not commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # 4.1 differing timestamps, same version (identical, in pkglint's
2147N/A # view unless we specifically look at the timestamp)
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.120:20101003T222523Z",
2147N/A "pkg://bar.org/tst@1.0,5.11-0.120:20311003T222559Z")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(not commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
3339N/A self.assertTrue(not is_successor(pair), fail_successor.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_timestamps=False),
3158N/A fail_newer_ts.format(pair))
2147N/A
2147N/A # 5.1 missing timestamps, same version
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.120",
2147N/A "pkg://bar.org/tst@1.0,5.11-0.120:20101003T222523Z")
3339N/A self.assertTrue(commutative(pair), fail_comm.format(pair))
3339N/A self.assertTrue(not commutative(pair, ignore_pubs=False),
3158N/A fail_comm_pubs.format(pair))
3339N/A self.assertTrue(not is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # 6.1 missing timestamps, different version
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.121",
2147N/A "pkg://bar.org/tst@1.0,5.11-0.120:20101003T222523Z")
3339N/A self.assertTrue(newer(pair), fail_newer.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # 7.1 different versions
2147N/A pair = FmriPair("pkg://foo.org/tst@1.0,5.11-0.121:20101003T222523Z",
2147N/A "pkg://bar.org/tst@1.0,5.11-0.120:20101003T222523Z")
3339N/A self.assertTrue(newer(pair), fail_newer.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # 8.1 different versions (where string comparisons won't work
2147N/A # with string comparisons, '0.133' < '0.99' which is not desired
2147N/A pair = FmriPair("pkg://opensolaris.org/SUNWfcsm@0.5.11,5.11-0.133:20100216T065435Z",
2147N/A "pkg://solaris/SUNWfcsm@0.5.11,5.11-0.99:20100216T065435Z")
3339N/A self.assertTrue(newer(pair), fail_newer.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
2147N/A
2147N/A # missing publishers
2147N/A pair = FmriPair("pkg:/tst", "pkg://foo.org/tst")
3339N/A self.assertTrue(commutative(pair), fail_newer.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # different publishers
2147N/A pair = FmriPair("pkg://bar.org/tst", "pkg://foo.org/tst")
3339N/A self.assertTrue(commutative(pair), fail_newer.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # different publishers, missing timestmap, same version
2147N/A pair = FmriPair("pkg://bar.org/tst@1.0,5.11-0.121",
2147N/A "pkg://foo.org/tst@1.0,5.11-0.121:20101003T222523Z")
3339N/A self.assertTrue(commutative(pair), fail_newer.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
3339N/A self.assertTrue(not is_successor(pair), fail_successor.format(pair))
2147N/A
2147N/A # different publishers, missing timestmap
2147N/A pair = FmriPair("pkg://bar.org/tst@1.0,5.11-0.122",
2147N/A "pkg://foo.org/tst@1.0,5.11-0.121:20101003T222523Z")
3339N/A self.assertTrue(newer(pair), fail_newer.format(pair))
3339N/A self.assertTrue(not newer(pair, ignore_pubs=False),
3158N/A fail_newer_pubs.format(pair))
3339N/A self.assertTrue(is_successor(pair), fail_successor.format(pair))
2147N/A
2046N/Adef read_manifests(names, lint_logger):
2046N/A "Read a list of filenames, return a list of Manifest objects"
2046N/A manifests = []
2046N/A for filename in names:
2046N/A data = None
2046N/A # borrowed code from publish.py
2046N/A lines = [] # giant string of all input lines
2046N/A linecnts = [] # tuples of starting line no., ending line no
2046N/A linecounter = 0 # running total
2046N/A try:
3234N/A data = open(filename).read()
3171N/A except IOError as e:
3158N/A lint_logger.error("Unable to read manifest file {0}".format(
3158N/A filename, msgid="lint.manifest001"))
2046N/A continue
2046N/A lines.append(data)
2046N/A linecnt = len(data.splitlines())
2046N/A linecnts.append((linecounter, linecounter + linecnt))
2046N/A linecounter += linecnt
2046N/A
2046N/A manifest = pkg.manifest.Manifest()
2046N/A try:
2046N/A manifest.set_content("\n".join(lines))
3171N/A except pkg.actions.ActionError as e:
2046N/A lineno = e.lineno
2046N/A for i, tup in enumerate(linecnts):
2046N/A if lineno > tup[0] and lineno <= tup[1]:
2046N/A lineno -= tup[0]
2046N/A break;
2046N/A else:
2046N/A lineno = "???"
2046N/A
2046N/A lint_logger.error(
3158N/A "Problem reading manifest {0} line: {1}: {2} ".format(
3158N/A filename, lineno, e), "lint.manifest002")
2046N/A continue
2046N/A
2046N/A if "pkg.fmri" in manifest:
2046N/A manifest.fmri = fmri.PkgFmri(
2046N/A manifest["pkg.fmri"])
2046N/A manifests.append(manifest)
2046N/A else:
2046N/A lint_logger.error(
3158N/A "Manifest {0} does not declare fmri.".format(filename),
2046N/A "lint.manifest003")
2046N/A return manifests
2046N/A
2046N/Aif __name__ == "__main__":
2046N/A unittest.main()