#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
from . import testutils
if __name__ == "__main__":
import pkg5unittest
import os
import unittest
bronze10 = """
open bronze@1.0,5.11-0
add set name=variant.arch value=sparc value=i386 value=zos
add dir mode=0755 owner=root group=bin path=/etc
add file tmp/bronze_zone/etc/nonglobal_motd mode=0555 owner=root group=bin path=etc/zone_motd variant.opensolaris.zone=nonglobal
add file tmp/bronze_zone/etc/global_motd mode=0555 owner=root group=bin path=etc/zone_motd variant.opensolaris.zone=global
add file tmp/bronze_zone/etc/sparc_nonglobal mode=0555 owner=root group=bin path=etc/zone_arch variant.arch=sparc variant.opensolaris.zone=nonglobal
add file tmp/bronze_zone/etc/i386_nonglobal mode=0555 owner=root group=bin path=etc/zone_arch variant.arch=i386 variant.opensolaris.zone=nonglobal
add file tmp/bronze_zone/etc/zos_nonglobal mode=0555 owner=root group=bin path=etc/zone_arch variant.arch=zos variant.opensolaris.zone=nonglobal
add file tmp/bronze_zone/etc/sparc_global mode=0555 owner=root group=bin path=etc/zone_arch variant.arch=sparc variant.opensolaris.zone=global
add file tmp/bronze_zone/etc/i386_global mode=0555 owner=root group=bin path=etc/zone_arch variant.arch=i386 variant.opensolaris.zone=global
add file tmp/bronze_zone/etc/zos_global mode=0555 owner=root group=bin path=etc/zone_arch variant.arch=zos variant.opensolaris.zone=global
add file tmp/bronze_zone/false mode=0555 owner=root group=bin path=etc/isdebug variant.debug.kernel=false
add file tmp/bronze_zone/true mode=0555 owner=root group=bin path=etc/isdebug variant.debug.kernel=true
close"""
silver10 = """
open silver@1.0,5.11-0
add set name=variant.arch value=i386
add dir mode=0755 owner=root group=bin path=/etc
close"""
mumble10 = """
open mumble-true@1.0,5.11-0
add set name=variant.mumble value=true
close
open mumble-false@1.0,5.11-0
add set name=variant.mumble value=false
close"""
mumblefratz = """
open mumblefratz@1.0,5.11-0
add set name=variant.mumble value=true
close
open mumblefratz@2.0,5.11-0
add set name=variant.mumble value=false
close"""
i386_pkg = """
open i386_pkg@1.0,5.11-0
add set name=variant.arch value=i386
close"""
i386_pkg_indirect = """
open i386_pkg_indirect@1.0,5.11-0
add depend type=require fmri=pkg:/i386_pkg@1.0,5.11-0
close"""
misc_files = [
"tmp/bronze_sparc/etc/motd",
"tmp/bronze_i386/etc/motd",
"tmp/bronze_zos/etc/motd",
"tmp/bronze_zone/false",
"tmp/bronze_zone/true",
]
"""Verify that install matching allows '*' even when some
packages are not supported by image variant."""
"""Verify that install matching for '@latest' matches the
newest version allowed by image variants."""
"""Verify that we can't indirectly install a package tagged
with a variant that doesn't match ours."""
# we should not be able to install an i386 package directly
# we should not be able to install an i386 package indirectly
"opensolaris.zone")
# Verify that unknown variants are implicitly false and shown in
# output of 'pkg variant' before any variants are set.
""" test if install works for spec'd arch"""
if isdebug:
else:
do_isdebug = ""
is_debug = "false"
if __name__ == "__main__":