581N/A# The contents of this file are subject to the terms of the 581N/A# Common Development and Distribution License (the "License"). 581N/A# You may not use this file except in compliance with the License. 581N/A# See the License for the specific language governing permissions 581N/A# and limitations under the License. 581N/A# When distributing Covered Code, include this CDDL HEADER in each 581N/A# If applicable, add the following below this CDDL HEADER, with the 581N/A# fields enclosed by brackets "[]" replaced with your own identifying 581N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3329N/A# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. 581N/A add dir mode=0755 owner=root group=bin path=/bin 738N/A add set name="description" value="Package to test package names with slashes" 738N/A add depend type=require fmri=pkg:/SUNWcsl 2859N/A add depend type=incorporate fmri=pkg:/foo 3130N/A add set name="description" value="Test for checking info_0 consistency" 3130N/A add set name="pkg.human-version" value="test of human version" 3130N/A add dir mode=0755 owner=root group=bin path=/bin 3131N/A # test_info() parses dates, 3131N/A # so set expected locale before starting depots 1895N/A # This suite, for obvious reasons, actually needs a depot. 581N/A """ Ping the depot several times """ 581N/A """ Start and stop the depot several times """ 581N/A """ Send package quux@1.0 an action at a time, restarting the 581N/A depot server after each one is sent, to ensure that 581N/A transactions work across depot restart. Then verify that 581N/A the package was successfully added by performing some 689N/A """Publish a package and then verify that the depot /info 689N/A operation doesn't fail.""" 933N/A """Verify that a depot will return a 400 (Bad Request) error 933N/A whenever it is provided malformed FMRIs.""" 933N/A "BRCMbnx%400.5.11%2C5.11-0.101%3A20081119T231649a"):
738N/A """Publish a package with slashes in the name, and then verify 738N/A that the depot manifest and info operations work regardless of 738N/A # First, try it un-encoded. 738N/A # Second, try it encoded. 3130N/A """Testing information showed in /info/0.""" 3339N/A # urlopen.read return bytes 1151N/A """Testing depotcontroller.refresh().""" 742N/A """Verify that files outside of the package content web root 742N/A cannot be accessed, and that files inside can be.""" 742N/A # any attempts to go outside that directory should fail 873N/A """Verify that starting a depot server in readonly mode with 1672N/A a non-existent or empty repo_dir fails and that permissions 1672N/A errors are handled correctly during creation. Then verify 1672N/A that starting a depot with the same directory in publishing 1672N/A mode works and then a readonly depot again after that works. 873N/A # First, test readonly mode with a repo_dir that doesn't exist. 873N/A # Next, test readonly mode with a repo_dir that is empty. 873N/A # Next, test readwrite (publishing) mode with a non-existent 1672N/A # Next, test readwrite (publishing) mode with a non-existent 1672N/A # repo_dir for an unprivileged user. 1672N/A # Even if this test fails, this wrapper must be reset. 873N/A # Next, test readwrite (publishing) mode with an empty repo_dir. 873N/A # Finally, re-test readonly mode now that the repository has 2026N/A """Test that if a depot has a partially finished append 2026N/A transaction, that it reopens it correctly.""" 2026N/A """Test that sending a non-signature action to an append 2026N/A transaction results in an error.""" 2044N/A """Verify that the depot server accepts a link to a 2044N/A directory as a repository root.""" 2044N/A # Create a link to the repository and verify that 2044N/A # the depot server allows it. 2044N/A # Reset for any tests that might execute afterwards. 2859N/A Test that a version-less incorporate dependency in a package 2859N/A doesn't cause a traceback and a 404 in the BUI. 3274N/A """Test that various publisher prefixes can be understood 3274N/A by CherryPy's dispatcher.""" 3274N/A # test that the catalog file can be found 975N/A """Tests whether the index and feed cache file are written to 975N/A the writable root parameter.""" 1431N/A """Verify that disable-ops works as expected.""" 1431N/A # For this disabled case, /catalog/1/ should return 1431N/A # For this disabled case, all /catalog/ operations should return 1431N/A # In the normal case, /catalog/1/ should return 1431N/A # A bogus operation should prevent the depot from starting. 1117N/A # Since these tests are output sensitive, the depots should be purged 817N/A add dir mode=0755 owner=root group=bin path=/bin 1899N/A add dir mode=0755 owner=root group=bin path=/var 817N/A add set name="description" value="Package to test package names with slashes" 817N/A add depend type=require fmri=pkg:/SUNWcsl 1117N/A "prefix":
"org.opensolaris.pending" 2028N/A "collection_type":
"supplemental",
2028N/A "Development packages for the contrib repository.",
2028N/A "name":
""""Pending" Repository""",
2028N/A "origins": [],
# Has to be set during setUp for correct origin. 1431N/A # Prevent override of custom configuration; 1431N/A # tests will set as needed. 2992N/A """Helper function: start a depot daemon and return a handler 2992N/A for its parent process and the port number it is running on. 2992N/A The parent process is a ctrun process. It is the user's 2992N/A responsibility to call depot_daemon_stop to stop the process. 2992N/A ctrun is used to kill the depot daemon process after finishing 2992N/A testing. It is needed because the double fork machanism of the 2992N/A daemonizer make the daemonized depot server indenpendent from 2992N/A repopath: The repository path that a depot daemon will run on. 2992N/A out_path: The depot daemon stdout log file path. 2992N/A err_path: The depot daemon stderr log file path.""" 2992N/A # Make sure the PKGDEPOT_CONTROLLER is not set in the newenv. 2992N/A # Start a depot daemon process. 2992N/A # Read the msgs from the err log file to verify log 2992N/A "empty. Check if the previous " 2992N/A """Helper function: stop the depot daemon process by sending 2992N/A # Terminate the depot daemon. If failed, kill it. 817N/A """Verify that a non-error response and valid HTML is returned 817N/A for each known BUI page in every available depot mode.""" 817N/A # A list of tuples containing the name of the method used to set 817N/A # the mode, and then the method needed to unset that mode. 817N/A (
"set_readwrite",
None),
817N/A (
"set_mirror",
"unset_mirror"),
817N/A (
"set_readonly",
"set_readwrite"),
2028N/A # Create repository and set publisher origins. 817N/A # Any error responses will cause an 2603N/A # Because the 'role' attribute used for 3130N/A # screen readers and other accessibility 2603N/A # tools isn't part of the official XHTML 2603N/A # 1.x standards, it has to be dropped 2603N/A # for the document to be validated. 2603N/A # Setting 'drop_prop_attrs' to True here 3130N/A # does that while ensuring that the 2603N/A # output of the depot is otherwise 1117N/A """Helper function to generate test repository configuration.""" 1117N/A # Find and load the repository configuration. 1117N/A # Update the configuration with our sample data. 2028N/A # Apply publisher properties and update. 1117N/A """Verify the output of the depot /publisher operation.""" 1117N/A # Now update the repository configuration while the depot is 1117N/A # stopped so changes won't be overwritten on exit. 3339N/A # entries's order is unstable in Python 3, but it doesn't really 3339N/A # matter as long as the prefix is in entries. 1117N/A # Now verify that the parsed response has the expected data. 3274N/A """Verify the output of the depot /p5i operation.""" 1117N/A # Now update the repository configuration while the depot is 1117N/A # stopped so changes won't be overwritten on exit. 1117N/A # Then, publish some packages we can abuse for testing. 1117N/A # Now, for each published package, attempt to get a p5i file 1117N/A # and then verify that the parsed response has the expected 1117N/A # package information under the expected publisher. 1431N/A # p5i files contain non-qualified FMRIs as the FMRIs 1431N/A # are already grouped by publisher. 1117N/A # Try again, but only using package stems. 1117N/A # Try again, but using wildcards (which will return a list of 1117N/A # Finally, verify that a non-existent package will error out 1117N/A # with a httplib.NOT_FOUND. 1899N/A """Ensure expected headers are present for client operations 1899N/A (excluding publication).""" 1899N/A # Now update the repository configuration while the depot is 1899N/A # stopped so changes won't be overwritten on exit. 2065N/A # Wait for search indexing to complete. 1899N/A 'search/1/False_2_None_None_%2Fvar%2Ffile',
3274N/A "file/0/3aad0bca6f3a6f502c175700ebe90ef36e312d7e"):
3339N/A # Fields must be referenced in lowercase. 3339N/A # Fields begin with uppercase. 2045N/A "file/0/3aad0bca6f3a6f502c175700ebe90ef36e312d7f"):
1850N/A """Test to make sure BUI search doesn't trigger a traceback.""" 1850N/A # Now update the repository configuration while the depot is 1850N/A # stopped so changes won't be overwritten on exit. 1850N/A # Then, publish some packages we can abuse for testing. 2230N/A """Verify that depot address can be set.""" 2230N/A # Check that IPv6 address can be used. 2230N/A # Check that we can retrieve something. 2992N/A """Verify that depot daemon works properly and the error 2992N/A message is logged properly.""" 2992N/A # Issue a bad request to trigger the server logging 2992N/A # Read the msgs from the err log file to verify log