t_pkg_api_hydrate.py revision 3339
4cb2599c5cdf27362a66ac475ce295409c093c92Timo Sirainen# CDDL HEADER START
1036d2db2b718bdc5b10f0773dd01d62638e9ba9Timo Sirainen# The contents of this file are subject to the terms of the
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen# Common Development and Distribution License (the "License").
1036d2db2b718bdc5b10f0773dd01d62638e9ba9Timo Sirainen# You may not use this file except in compliance with the License.
4cb2599c5cdf27362a66ac475ce295409c093c92Timo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4cb2599c5cdf27362a66ac475ce295409c093c92Timo Sirainen# See the License for the specific language governing permissions
4cb2599c5cdf27362a66ac475ce295409c093c92Timo Sirainen# and limitations under the License.
d758298b3b6f1ebcd494392c0f20b0e119a9e85eTimo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
546d3609e0811a147269ee9979eb90649445f5acTimo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7cd08c67fde5371f662d8c95b30c341741950420Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
f77ffa31038d46ca9c6d24d93e3d76c9aa8d4d0cTimo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
f77ffa31038d46ca9c6d24d93e3d76c9aa8d4d0cTimo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen# CDDL HEADER END
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainenclass TestPkgApiHydrate(pkg5unittest.SingleDepotTestCase):
43d32cbe60fdaef2699d99f1ca259053e9350411Timo Sirainen open dev@1.0,5.11-0
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen add dir mode=0755 owner=root group=bin path=dev
cd700cc7be045389dd1c948b2372b30ee99c5795Timo Sirainen add dir mode=0755 owner=root group=bin path=dev/cfg
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen add file dev/cfg/bar path=dev/cfg/bar mode=0644 owner=root group=bin preserve=true
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen add file dev/cfg/bar1 path=dev/cfg/bar1 mode=0555 owner=root group=bin
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen add file dev/cfg/bar2 path=dev/cfg/bar2 mode=0644 owner=root group=bin overlay=true
43d32cbe60fdaef2699d99f1ca259053e9350411Timo Sirainen add hardlink path=dev/cfg/bar2.hlink target=bar2
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen misc_files = ["dev/cfg/bar", "dev/cfg/bar1", "dev/cfg/bar2",
8e0f89885f2ce60961da9ae2d96d71c7109e6032Timo Sirainen # Verify that files are deleted or remained as expected.
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen # Test that dehydrate will raise a PlanCreationException when
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen # encountering bad publishers.
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen self.assertRaises(api_errors.PlanCreationException,
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen api_inst.gen_plan_dehydrate(*args, **kwargs)),
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen # Test that rehydrate will raise a PlanCreationException when
a40649829bce4c8de6210a2cb4a4b4cf5bb40da8Timo Sirainen # encountering bad publishers.
bb979386852c7689dc66c0fce03319382f66d501Timo Sirainen self.assertRaises(api_errors.PlanCreationException,