#
# 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 tempfile
import time
import unittest
import zlib
# Cleanup after every test.
scheme10 = """
open pkg:/scheme@1.0,5.11-0
close
"""
tree10 = """
open tree@1.0,5.11-0
close
"""
amber10 = """
open amber@1.0,5.11-0
add depend fmri=pkg:/tree@1.0 type=require
close
"""
amber20 = """
open amber@2.0,5.11-0
add depend fmri=pkg:/tree@1.0 type=require
close
"""
bronze10 = """
open bronze@1.0,5.11-0
add dir mode=0755 owner=root group=bin path=/usr
add hardlink path=/lib/libc.bronze target=/lib/libc.so.1
add depend fmri=pkg:/amber@1.0 type=require
add license tmp/copyright2 license=copyright
close
"""
bronze20 = """
open bronze@2.0,5.11-0
add dir mode=0755 owner=root group=bin path=/etc
add dir mode=0755 owner=root group=bin path=/lib
add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.bronze
add hardlink path=/lib/libc.bronze2.0.hardlink target=/lib/libc.so.1
add license tmp/copyright3 license=copyright
add depend fmri=pkg:/amber@2.0 type=require
close
"""
"tmp/copyright2", "tmp/copyright3",
""" Start two depots.
depot 1 gets foo and moo, depot 2 gets foo and bar
depot1 is mapped to publisher test1 (preferred)
depot2 is mapped to publisher test2 """
# This test suite needs an actual depot.
# Publish a set of packages to one repository.
# Ensure timestamps of all successive publications are greater.
# Publish the same set to another repository (minus the tree
# and scheme packages).
try:
except cfg.ConfigError as e:
"repository's configuration data is not "
"valid:\n{0}").format(e))
"""Verify that merge functionality works as expected."""
flist = []
])
# Only get the newest FMRIs for each package.
nlist = {}
continue
def get_expected(f):
# Not in this repository, check next.
continue
for l in m:
continue
continue
if not l.strip():
continue
m.close()
# These packages are only published for sparc.
else:
# Everything else is published for all variants.
# Now load the manifest file for each package and verify that
# the merged manifest matches expectations.
for f in nlist:
m.close()
# Generate expected and verify.
expected = get_expected(f)
if __name__ == "__main__":