t_pkg_depotd.py revision 1116
905N/A# The contents of this file are subject to the terms of the 905N/A# Common Development and Distribution License (the "License"). 905N/A# You may not use this file except in compliance with the License. 905N/A# See the License for the specific language governing permissions 905N/A# and limitations under the License. 905N/A# When distributing Covered Code, include this CDDL HEADER in each 905N/A# If applicable, add the following below this CDDL HEADER, with the 905N/A# fields enclosed by brackets "[]" replaced with your own identifying 905N/A# information: Portions Copyright [yyyy] [name of copyright owner] 905N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 905N/A# Use is subject to license terms. 4448N/A add dir mode=0755 owner=root group=bin path=/bin add set name="description" value="Package to test package names with slashes" add dir path=tmp/foo mode=0755 owner=root group=bin add depend type=require fmri=pkg:/SUNWcsl # write the name of the file into the file, so that # all files have differing contents """ Ping the depot several times """ """ Start and stop the depot several times """ """ Send package quux@1.0 an action at a time, restarting the depot server after each one is sent, to ensure that transactions work across depot restart. Then verify that the package was successfully added by performing some """Publish a package and then verify that the depot /info operation doesn't fail.""" """Verify that a depot will return a 400 (Bad Request) error whenever it is provided malformed FMRIs.""" for entry in (
"BRCMbnx",
"BRCMbnx%40a",
"BRCMbnx%400.5.11%2C5.11-0.101%3A20081119T231649a"):
"""Publish a package with slashes in the name, and then verify that the depot manifest and info operations work regardless of # First, try it un-encoded. # Second, try it encoded. """Publish stuff to the depot, get a full version of the catalog. Extract the Last-Modified timestamp from the catalog and request an incremental update with the Last-Modified timestamp. Server should return a HTTP 304. Fail if this hdr = {
"If-Modified-Since":
lm}
# Server returns NOT_MODIFIED if catalog is up # 200 OK won't raise an exception, but it's still a failure. # Now send another package and verify that we get an """Verify that files outside of the package content web root cannot be accessed, and that files inside can be.""" # any attempts to go outside that directory should fail """Verify that starting a depot server in readonly mode with a non-existent or empty repo_dir fails. Then verify that starting a depot with the same directory in publishing mode works and then a readonly depot again after that works.""" # First, test readonly mode with a repo_dir that doesn't exist. # Next, test readonly mode with a repo_dir that is empty. # Next, test readwrite (publishing) mode with a non-existent # Next, test readwrite (publishing) mode with an empty repo_dir. # Finally, re-test readonly mode now that the repository has """Tests whether the index and feed cache file are written to the writable root parameter.""" # write the name of the file into the file, so that # all files have differing contents add dir mode=0755 owner=root group=bin path=/bin add set name="description" value="Package to test package names with slashes" add dir path=tmp/foo mode=0755 owner=root group=bin add depend type=require fmri=pkg:/SUNWcsl """Verify that a non-error response and valid HTML is returned for each known BUI page in every available depot mode.""" # A list of tuples containing the name of the method used to set # the mode, and then the method needed to unset that mode. (
"set_mirror",
"unset_mirror"),
(
"set_readonly",
"set_readwrite"),
# Any error responses will cause an