src/tests/cli/t_api_search.py
author johansen <johansen@sun.com>
Wed, 01 Jul 2009 16:18:33 -0700
changeset 1191 a48bee2a4b2e
parent 1146 7c10e9798405
child 1230 4bc74e5d6c3d
permissions -rw-r--r--
305 http_proxy value needs more checking for valid url syntax 2341 Client should be more conservative about closing sockets 4235 Misleading "node name" unknown messages when http_proxy set incorrectly 4495 Want ability to cancel individual file downloads 8902 Need a transport that downloads files by GET 9508 Captive portal test only run during catalog refresh 9613 Implicit refresh should raise InvalidDepotResponseException 9615 EOL clientside search v0 9629 EOL clientside support for filelist 9630 Hostile depot should live with other depot code 9631 HTTPS transport should be more rigorous in verification 9670 More specific error exceptions requested from search 9686 network operations should use accept-encoding when appropriate 9715 The info() operation should use the activity_lock
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     1
#!/usr/bin/python2.4
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     2
#
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     3
# CDDL HEADER START
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     4
#
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     8
#
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    12
# and limitations under the License.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    13
#
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    19
#
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    20
# CDDL HEADER END
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    21
#
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    22
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    23
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    24
# Use is subject to license terms.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    25
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    26
import testutils
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    27
if __name__ == "__main__":
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    28
	testutils.setup_environment("../../../proto")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    29
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    30
import unittest
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    31
import os
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    32
import sys
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    33
import copy
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    34
import re
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    35
import shutil
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    36
import difflib
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    37
import time
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    38
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    39
import pkg.client.api as api
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    40
import pkg.client.api_errors as api_errors
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    41
import pkg.client.query_parser as query_parser
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    42
import pkg.client.progress as progress
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    43
import pkg.fmri as fmri
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    44
import pkg.portable as portable
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    45
import pkg.search_storage as ss
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    46
1141
a74d6815a7fc 4178 unfound_fmris is a poor name
Rich Burridge <rich.burridge@sun.com>
parents: 1127
diff changeset
    47
API_VERSION = 15
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    48
PKG_CLIENT_NAME = "pkg"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    49
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    50
class TestApiSearchBasics(testutils.SingleDepotTestCase):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    51
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    52
        example_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    53
            open [email protected],5.11-0
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    54
            add dir mode=0755 owner=root group=bin path=/bin
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    55
            add dir mode=0755 owner=root group=bin path=/bin/example_dir
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    56
            add dir mode=0755 owner=root group=bin path=/usr/lib/python2.4/vendor-packages/OpenSSL
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    57
            add file /tmp/example_file mode=0555 owner=root group=bin path=/bin/example_path
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    58
            add set name=com.sun.service.incorporated_changes value="6556919 6627937"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    59
            add set name=com.sun.service.random_test value=42 value=79
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    60
            add set name=com.sun.service.bug_ids value="4641790 4725245 4817791 4851433 4897491 4913776 6178339 6556919 6627937"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    61
            add set name=com.sun.service.keywords value="sort null -n -m -t sort 0x86 separator"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    62
            add set name=com.sun.service.info_url value=http://service.opensolaris.com/xml/pkg/[email protected],5.11-1:20080514I120000Z
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    63
            add set description='FOOO bAr O OO OOO'
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    64
            add set name='weirdness' value='] [ * ?'
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    65
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    66
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    67
        example_pkg11 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    68
            open [email protected],5.11-0
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    69
            add dir mode=0755 owner=root group=bin path=/bin
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    70
            add file /tmp/example_file mode=0555 owner=root group=bin path=/bin/example_path11
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    71
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    72
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    73
        another_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    74
            open [email protected],5.11-0
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    75
            add dir mode=0755 owner=root group=bin path=/bin
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    76
            add dir mode=0755 owner=root group=bin path=/bin/another_dir
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    77
            add file /tmp/example_file mode=0555 owner=root group=bin path=/bin/another_path
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    78
            add set name=com.sun.service.incorporated_changes value="6556919 6627937"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    79
            add set name=com.sun.service.random_test value=42 value=79
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    80
            add set name=com.sun.service.bug_ids value="4641790 4725245 4817791 4851433 4897491 4913776 6178339 6556919 6627937"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    81
            add set name=com.sun.service.keywords value="sort null -n -m -t sort 0x86 separator"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    82
            add set name=com.sun.service.info_url value=http://service.opensolaris.com/xml/pkg/[email protected],5.11-1:20080514I120000Z
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    83
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    84
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    85
        bad_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    86
            open [email protected],5.11-0
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
    87
            add dir path=badfoo/ mode=0755 owner=root group=bin
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    88
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    89
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    90
        space_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    91
            open [email protected],5.11-0
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    92
            add file /tmp/example_file mode=0444 owner=nobody group=sys path='unique/with a space'
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    93
            add dir mode=0755 owner=root group=bin path=unique_dir
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    94
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    95
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    96
        cat_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    97
            open [email protected],5.11-0
1115
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
    98
            add set name=info.classification value=org.opensolaris.category.2008:System/Security value=org.random:Other/Category
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
    99
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   100
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   101
        cat2_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   102
            open [email protected],5.11-0
1115
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   103
            add set name=info.classification value="org.opensolaris.category.2008:Applications/Sound and Video" value=Developer/C
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   104
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   105
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   106
        cat3_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   107
            open [email protected],5.11-0
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   108
            add set name=info.classification value="org.opensolaris.category.2008:foo/bar/baz/bill/beam/asda"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   109
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   110
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   111
        bad_cat_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   112
            open [email protected],5.11-0
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   113
            add set name=info.classification value="TestBad1/TestBad2"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   114
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   115
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   116
        bad_cat2_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   117
            open [email protected],5.11-0
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   118
            add set name=info.classification value="org.opensolaris.category.2008:TestBad1:TestBad2"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   119
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   120
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   121
        fat_pkg10 = """
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   122
open [email protected],5.11-0
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   123
add set name=variant.arch value=sparc value=i386
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   124
add set name=description value="i386 variant" variant.arch=i386
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   125
add set name=description value="sparc variant" variant.arch=sparc
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   126
close """
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   128
        bogus_pkg10 = """
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   129
set name=fmri value=pkg:/[email protected],5.11-0:20090326T233451Z
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   130
set name=description value=""validation with simple chains of constraints ""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   131
set name=pkg.description value="pseudo-hashes as arrays tied to a "type" (list of fields)"
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   132
depend fmri=XML-Atom-Entry
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   133
set name=com.sun.service.incorporated_changes value="6556919 6627937"
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   134
"""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   135
        bogus_fmri = fmri.PkgFmri("[email protected],5.11-0:20090326T233451Z")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   136
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   137
        res_remote_path = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   138
            ("pkg:/[email protected]", "basename","file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path pkg.csize=38 pkg.size=18")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   139
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   140
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   141
        res_remote_bin = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   142
            ("pkg:/[email protected]", "path", "dir group=bin mode=0755 owner=root path=bin")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   143
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   144
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   145
        res_remote_openssl = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   146
            ("pkg:/[email protected]", "basename", "dir group=bin mode=0755 owner=root path=usr/lib/python2.4/vendor-packages/OpenSSL")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   147
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   148
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   149
        res_remote_bug_id = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   150
            ("pkg:/[email protected]", "4851433", 'set name=com.sun.service.bug_ids value="4641790 4725245 4817791 4851433 4897491 4913776 6178339 6556919 6627937"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   151
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   152
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   153
        res_remote_bug_id_4725245 = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   154
            ("pkg:/[email protected]", "4725245", 'set name=com.sun.service.bug_ids value="4641790 4725245 4817791 4851433 4897491 4913776 6178339 6556919 6627937"')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   155
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   156
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   157
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   158
        res_remote_inc_changes = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   159
            ("pkg:/[email protected]", "6556919", 'set name=com.sun.service.incorporated_changes value="6556919 6627937"'),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   160
            ("pkg:/[email protected]", "6556919", 'set name=com.sun.service.bug_ids value="4641790 4725245 4817791 4851433 4897491 4913776 6178339 6556919 6627937"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   161
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   162
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   163
        res_remote_random_test = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   164
            ("pkg:/[email protected]", "42", "set name=com.sun.service.random_test value=42 value=79")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   165
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   166
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   167
        res_remote_random_test_79 = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   168
            ("pkg:/[email protected]", "79", "set name=com.sun.service.random_test value=42 value=79")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   169
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   170
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   171
        res_remote_keywords = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   172
            ("pkg:/[email protected]", "separator", 'set name=com.sun.service.keywords value="sort null -n -m -t sort 0x86 separator"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   173
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   174
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   175
        res_remote_keywords_sort_phrase = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   176
            ("pkg:/[email protected]", "sort 0x86", 'set name=com.sun.service.keywords value="sort null -n -m -t sort 0x86 separator"')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   177
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   178
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   179
        res_remote_wildcard = res_remote_path.union(set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   180
            ('pkg:/[email protected]', 'basename', 'dir group=bin mode=0755 owner=root path=bin/example_dir')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   181
        ]))
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   182
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   183
        res_remote_glob = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   184
            ('pkg:/[email protected]', 'path', 'dir group=bin mode=0755 owner=root path=bin/example_dir'),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   185
            ('pkg:/[email protected]', 'basename', 'dir group=bin mode=0755 owner=root path=bin/example_dir'),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   186
            ('pkg:/[email protected]', 'path', 'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path pkg.csize=38 pkg.size=18')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   187
        ]) | res_remote_path
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   188
                                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   189
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   190
        res_remote_foo = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   191
            ('pkg:/[email protected]', 'FOOO', 'set name=description value="FOOO bAr O OO OOO"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   192
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   193
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   194
        res_remote_bar = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   195
            ('pkg:/[email protected]', 'bAr', 'set name=description value="FOOO bAr O OO OOO"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   196
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   197
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   198
        res_remote_star = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   199
            ('pkg:/[email protected]', '*', 'set name=weirdness value="] [ * ?"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   200
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   201
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   202
        res_remote_mark = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   203
            ('pkg:/[email protected]', '?', 'set name=weirdness value="] [ * ?"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   204
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   205
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   206
        res_remote_left_brace = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   207
            ('pkg:/[email protected]', '[', 'set name=weirdness value="] [ * ?"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   208
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   209
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   210
        res_remote_right_brace = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   211
            ('pkg:/[email protected]', ']', 'set name=weirdness value="] [ * ?"')    
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   212
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   213
        
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   214
        local_fmri_string = \
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   215
            ('pkg:/[email protected]', 'example_pkg', '')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   216
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   217
        res_local_pkg = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   218
                local_fmri_string
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   219
                ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   220
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   221
        res_local_path = copy.copy(res_remote_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   222
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   223
        res_local_bin = copy.copy(res_remote_bin)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   224
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   225
        res_local_bug_id = copy.copy(res_remote_bug_id)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   226
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   227
        res_local_inc_changes = copy.copy(res_remote_inc_changes)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   228
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   229
        res_local_random_test = copy.copy(res_remote_random_test)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   230
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   231
        res_local_keywords = copy.copy(res_remote_keywords)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   232
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   233
        res_local_wildcard = copy.copy(res_remote_wildcard)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   234
        res_local_wildcard.add(local_fmri_string)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   235
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   236
        res_local_glob = copy.copy(res_remote_glob)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   237
        res_local_glob.add(local_fmri_string)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   238
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   239
        res_local_foo = copy.copy(res_remote_foo)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   240
        res_local_bar = copy.copy(res_remote_bar)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   241
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   242
        res_local_openssl = copy.copy(res_remote_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   243
        
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   244
        res_local_path_example11 = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   245
            ("pkg:/[email protected]", "basename", "file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path11 pkg.csize=38 pkg.size=18")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   246
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   247
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   248
        res_local_bin_example11 = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   249
            ("pkg:/[email protected]", "path", "dir group=bin mode=0755 owner=root path=bin")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   250
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   251
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   252
        res_local_wildcard_example11 = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   253
            ("pkg:/[email protected]", "basename", "file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path11 pkg.csize=38 pkg.size=18"),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   254
            ("pkg:/[email protected]", "example_pkg", "")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   255
       ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   256
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   257
        res_local_pkg_example11 = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   258
            ("pkg:/[email protected]", "example_pkg", "")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   259
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   260
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   261
        res_cat_pkg10 = set([
1115
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   262
            ('pkg:/[email protected]', 'System/Security', 'set name=info.classification value=org.opensolaris.category.2008:System/Security value=org.random:Other/Category')
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   263
        ])
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   264
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   265
        res_cat_pkg10_2 = set([
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   266
            ('pkg:/[email protected]', 'Other/Category', 'set name=info.classification value=org.opensolaris.category.2008:System/Security value=org.random:Other/Category')
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   267
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   268
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   269
        res_cat2_pkg10 = set([
1115
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   270
            ('pkg:/[email protected]', 'Applications/Sound and Video', 'set name=info.classification value="org.opensolaris.category.2008:Applications/Sound and Video" value=Developer/C')
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   271
        ])
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   272
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   273
        res_cat2_pkg10_2 = set([
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
   274
            ('pkg:/[email protected]', 'Developer/C', 'set name=info.classification value="org.opensolaris.category.2008:Applications/Sound and Video" value=Developer/C')
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   275
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   276
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   277
        res_cat3_pkg10 = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   278
            ('pkg:/[email protected]', 'foo/bar/baz/bill/beam/asda', 'set name=info.classification value=org.opensolaris.category.2008:foo/bar/baz/bill/beam/asda')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   279
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   280
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   281
        res_fat10_i386 = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   282
            ('pkg:/[email protected]', 'i386', 'set name=description value="i386 variant" variant.arch=i386'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   283
            ('pkg:/[email protected]', 'variant', 'set name=description value="i386 variant" variant.arch=i386'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   284
            ('pkg:/[email protected]', 'i386', 'set name=variant.arch value=sparc value=i386'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   285
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   286
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   287
        res_fat10_sparc = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   288
            ('pkg:/[email protected]', 'sparc', 'set name=description value="sparc variant" variant.arch=sparc'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   289
            ('pkg:/[email protected]', 'sparc', 'set name=variant.arch value=sparc value=i386'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   290
            ('pkg:/[email protected]', 'variant', 'set name=description value="sparc variant" variant.arch=sparc')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   291
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   292
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   293
        res_remote_fat10_star = res_fat10_sparc | res_fat10_i386
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   294
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   295
        res_local_fat10_i386_star = res_fat10_i386.union(set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   296
            ('pkg:/[email protected]', 'test', 'set name=publisher value=test'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   297
            ('pkg:/[email protected]', 'fat', ''),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   298
            ('pkg:/[email protected]', 'sparc', 'set name=variant.arch value=sparc value=i386')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   299
        ]))
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   300
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   301
        res_local_fat10_sparc_star = res_fat10_sparc.union(set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   302
            ('pkg:/[email protected]', 'test', 'set name=publisher value=test'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   303
            ('pkg:/[email protected]', 'fat', ''),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   304
            ('pkg:/[email protected]', 'i386', 'set name=variant.arch value=sparc value=i386')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   305
        ]))
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   306
        
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   307
        res_space_with_star = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   308
            ('pkg:/[email protected]', 'basename', 'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=sys mode=0444 owner=nobody path="unique/with a space" pkg.csize=38 pkg.size=18')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   309
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   310
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   311
        res_space_space_star = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   312
            ('pkg:/[email protected]', 'basename', 'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=sys mode=0444 owner=nobody path="unique/with a space" pkg.csize=38 pkg.size=18'), ('pkg:/[email protected]', 'path', 'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=sys mode=0444 owner=nobody path="unique/with a space" pkg.csize=38 pkg.size=18')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   313
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   314
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   315
        res_space_unique = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   316
            ('pkg:/[email protected]', 'basename', 'dir group=bin mode=0755 owner=root path=unique_dir')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   317
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   318
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   319
        misc_files = ['/tmp/example_file']
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   320
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   321
        # This is a copy of the 3.81%2C5.11-0.89%3A20080527T163123Z version of
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   322
        # SUNWgmake from ipkg with the file and liscense actions changed so
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   323
        # that they all take /tmp/example file when sending.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   324
        bug_983_manifest = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   325
open [email protected],5.11-0.89
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   326
add dir group=sys mode=0755 owner=root path=usr
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   327
add dir group=bin mode=0755 owner=root path=usr/bin
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   328
add dir group=bin mode=0755 owner=root path=usr/gnu
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   329
add dir group=bin mode=0755 owner=root path=usr/gnu/bin
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   330
add link path=usr/gnu/bin/make target=../../bin/gmake
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   331
add dir group=sys mode=0755 owner=root path=usr/gnu/share
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   332
add dir group=bin mode=0755 owner=root path=usr/gnu/share/man
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   333
add dir group=bin mode=0755 owner=root path=usr/gnu/share/man/man1
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   334
add link path=usr/gnu/share/man/man1/make.1 target=../../../../share/man/man1/gmake.1
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   335
add dir group=bin mode=0755 owner=root path=usr/sfw
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   336
add dir group=bin mode=0755 owner=root path=usr/sfw/bin
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   337
add link path=usr/sfw/bin/gmake target=../../bin/gmake
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   338
add dir group=bin mode=0755 owner=root path=usr/sfw/share
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   339
add dir group=bin mode=0755 owner=root path=usr/sfw/share/man
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   340
add dir group=bin mode=0755 owner=root path=usr/sfw/share/man/man1
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   341
add link path=usr/sfw/share/man/man1/gmake.1 target=../../../../share/man/man1/gmake.1
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   342
add dir group=sys mode=0755 owner=root path=usr/share
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   343
add dir group=bin mode=0755 owner=root path=usr/share/info
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   344
add dir group=bin mode=0755 owner=root path=usr/share/man
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   345
add dir group=bin mode=0755 owner=root path=usr/share/man/man1
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   346
add file /tmp/example_file elfarch=i386 elfbits=32 elfhash=68cca393e816e6adcbac1e8ffe9c618de70413e0 group=bin mode=0555 owner=root path=usr/bin/gmake pkg.size=18
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   347
add file /tmp/example_file group=bin mode=0444 owner=root path=usr/share/info/make.info pkg.size=18
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   348
add file /tmp/example_file group=bin mode=0444 owner=root path=usr/share/info/make.info-1 pkg.size=18
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   349
add file /tmp/example_file group=bin mode=0444 owner=root path=usr/share/info/make.info-2 pkg.size=18
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   350
add file /tmp/example_file group=bin mode=0444 owner=root path=usr/share/man/man1/gmake.1 pkg.size=18
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   351
add license /tmp/example_file license=SUNWgmake.copyright pkg.size=18 transaction_id=1211931083_pkg%3A%2FSUNWgmake%403.81%2C5.11-0.89%3A20080527T163123Z
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   352
add depend fmri=pkg:/[email protected] type=require
1146
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   353
add depend [email protected] type=require
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   354
add depend [email protected] type=incorporate
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   355
add set name=description value="gmake - GNU make"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   356
add legacy arch=i386 category=system desc="GNU make - A utility used to build software (gmake) 3.81" hotline="Please contact your local service provider" name="gmake - GNU make" pkg=SUNWgmake vendor="Sun Microsystems, Inc." version=11.11.0,REV=2008.04.29.02.08
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   357
close
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   358
"""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   359
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   360
        res_bug_983 = set([
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   361
            ("pkg:/[email protected]", "basename", "link path=usr/sfw/bin/gmake target=../../bin/gmake"),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   362
            ('pkg:/[email protected]', 'basename', 'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 elfarch=i386 elfbits=32 elfhash=68cca393e816e6adcbac1e8ffe9c618de70413e0 group=bin mode=0555 owner=root path=usr/bin/gmake pkg.csize=38 pkg.size=18'),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   363
            ('pkg:/[email protected]', 'gmake', 'set name=description value="gmake - GNU make"')
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   364
        ])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   365
1146
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   366
        res_983_csl_dependency = set([
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   367
            ('pkg:/[email protected]', 'require', 'depend fmri=pkg:/[email protected] type=require')
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   368
        ])
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   369
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   370
        res_983_bar_dependency = set([
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   371
            ('pkg:/[email protected]', 'require', 'depend [email protected] type=require')
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   372
        ])
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   373
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   374
        res_983_foo_dependency = set([
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   375
            ('pkg:/[email protected]', 'incorporate', 'depend [email protected] type=incorporate')
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   376
        ])
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
   377
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   378
        res_local_pkg_ret_pkg = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   379
            "pkg:/[email protected]"
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   380
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   381
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   382
        res_remote_pkg_ret_pkg = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   383
            "pkg:/[email protected]"
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   384
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   385
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   386
        res_remote_file = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   387
            ('pkg:/[email protected]',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   388
             'path',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   389
             'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path pkg.csize=38 pkg.size=18'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   390
            ('pkg:/[email protected]',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   391
             '820157a2043e3135f342b238129b556aade20347',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   392
             'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path pkg.csize=38 pkg.size=18')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   393
        ]) | res_remote_path
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   394
        
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   395
        res_remote_url = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   396
            ('pkg:/[email protected]',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   397
            'http://service.opensolaris.com/xml/pkg/[email protected],5.11-1:20080514I120000Z',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   398
            'set name=com.sun.service.info_url value=http://service.opensolaris.com/xml/pkg/[email protected],5.11-1:20080514I120000Z')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   399
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   400
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   401
        res_remote_path_extra = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   402
            ('pkg:/[email protected]',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   403
             'basename',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   404
             'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path pkg.csize=38 pkg.size=18'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   405
            ('pkg:/[email protected]',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   406
             'path',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   407
             'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path pkg.csize=38 pkg.size=18'),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   408
            ('pkg:/[email protected]',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   409
             '820157a2043e3135f342b238129b556aade20347',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   410
             'file 820157a2043e3135f342b238129b556aade20347 chash=bfa46fc98d1ca97f1260090797d35a35e76096a3 group=bin mode=0555 owner=root path=bin/example_path pkg.csize=38 pkg.size=18')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   411
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   412
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   413
        res_bad_pkg = set([
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   414
            ('pkg:/[email protected]', 'basename',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   415
             'dir group=bin mode=0755 owner=root path=badfoo/')
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   416
        ])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   417
        
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   418
        debug_features = None
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   419
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   420
        def setUp(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   421
                for p in self.misc_files:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   422
                        f = open(p, "w")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   423
                        # Write the name of the file into the file, so that
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   424
                        # all files have differing contents.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   425
                        f.write(p + "\n")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   426
                        f.close()
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
   427
                testutils.SingleDepotTestCase.setUp(self,
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   428
                    debug_features=self.debug_features)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   429
                tp = self.get_test_prefix()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   430
                self.testdata_dir = os.path.join(tp, "search_results")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   431
                os.mkdir(self.testdata_dir)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   432
                self._dir_restore_functions = [self._restore_dir,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   433
                    self._restore_dir_preserve_hash]
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   434
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   435
        def tearDown(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   436
                testutils.SingleDepotTestCase.tearDown(self)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   437
                for p in self.misc_files:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   438
                        os.remove(p)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   439
                shutil.rmtree(self.testdata_dir)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   440
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   441
        def _check(self, proposed_answer, correct_answer):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   442
                if correct_answer == proposed_answer:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   443
                        return True
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   444
                else:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   445
                        print "Proposed Answer: " + str(proposed_answer)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   446
                        print "Correct Answer : " + str(correct_answer)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   447
                        if isinstance(correct_answer, set) and \
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   448
                            isinstance(proposed_answer, set):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   449
                                print >> sys.stderr, "Missing: " + \
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   450
                                    str(correct_answer - proposed_answer)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   451
                                print >> sys.stderr, "Extra  : " + \
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   452
                                    str(proposed_answer - correct_answer)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   453
                        self.assert_(correct_answer == proposed_answer)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   454
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   455
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   456
        def _replace_act(act):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   457
                if act.startswith('set name=fmri'):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   458
                        return ''
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   459
                else:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   460
                        return act.strip()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   461
                        
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   462
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   463
        def _extract_action_from_res(it):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   464
                return (
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   465
                    (fmri.PkgFmri(str(pkg_name)).get_short_fmri(), piece,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   466
                    TestApiSearchBasics._replace_act(act))
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   467
                    for query_num, auth, (version, return_type,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   468
                    (pkg_name, piece, act))
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   469
                    in it
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   470
                )
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   471
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   472
        @staticmethod
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   473
        def _extract_package_from_res(it):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   474
                return (
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   475
                    (fmri.PkgFmri(str(pkg_name)).get_short_fmri())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   476
                    for query_num, auth, (version, return_type, pkg_name)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   477
                    in it
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   478
                )
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   479
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   480
        def _search_op(self, api_obj, remote, token, test_value,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   481
            case_sensitive=False, return_actions=True, num_to_return=None,
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
   482
            start_point=None, servers=None):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   483
                search_func = api_obj.local_search
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   484
                if remote:
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
   485
                        search_func = lambda x: api_obj.remote_search(x,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
   486
                            servers=servers)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   487
                query = api.Query(token, case_sensitive, return_actions,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   488
                    num_to_return, start_point)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   489
                res = search_func([query])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   490
                if return_actions:
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   491
                        res = self._extract_action_from_res(res)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   492
                else:
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   493
                        res = self._extract_package_from_res(res)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   494
                res = set(res)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   495
                self._check(set(res), test_value)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   496
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   497
        def _search_op_slow(self, api_obj, remote, token, test_value,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   498
            case_sensitive=False, return_actions=True, num_to_return=None,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   499
            start_point=None):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   500
                search_func = api_obj.local_search
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   501
                if remote:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   502
                        search_func = api_obj.remote_search
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   503
                query = api.Query(token, case_sensitive, return_actions,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   504
                    num_to_return, start_point)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   505
                tmp = search_func([query])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   506
                res = []
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   507
                ssu = False
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   508
                try:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   509
                        for i in tmp:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   510
                                res.append(i)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   511
                except api_errors.SlowSearchUsed:
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   512
                        ssu = True
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   513
                self.assert_(ssu)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   514
                if return_actions:
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   515
                        res = self._extract_action_from_res(res)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   516
                else:
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   517
                        res = self._extract_package_from_res(res)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   518
                res = set(res)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   519
                self._check(set(res), test_value)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   520
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   521
        def _run_full_remote_tests(self, api_obj):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   522
                # Set to 1 since searches can't currently be performed
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   523
                # package name unless it's set inside the
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   524
                # manifest which happens at install time on
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   525
                # the client side.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   526
                self._search_op(api_obj, True, "example_pkg", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   527
                self._search_op(api_obj, True, "example_path",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   528
                    self.res_remote_path)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   529
                self._search_op(api_obj, True, "(example_path)",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   530
                    self.res_remote_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   531
                self._search_op(api_obj, True, "<exam*:::>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   532
                    self.res_remote_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   533
                self._search_op(api_obj, True, "::com.sun.service.info_url:",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   534
                    self.res_remote_url)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   535
                self._search_op(api_obj, True, ":::e* AND *path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   536
                    self.res_remote_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   537
                self._search_op(api_obj, True, "e* AND *path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   538
                    self.res_remote_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   539
                self._search_op(api_obj, True, "<e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   540
                    self.res_remote_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   541
                self._search_op(api_obj, True, "<e*> AND <e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   542
                    self.res_remote_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   543
                self._search_op(api_obj, True, "<e*> OR <e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   544
                    self.res_remote_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   545
                self._search_op(api_obj, True, "<exam:::>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   546
                    self.res_remote_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   547
                self._search_op(api_obj, True, "exam:::e*path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   548
                    self.res_remote_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   549
                self._search_op(api_obj, True, "exam:::e*path AND e*:::",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   550
                    self.res_remote_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   551
                self._search_op(api_obj, True, "e*::: AND exam:::*path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   552
                    self.res_remote_path_extra)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   553
                self._search_op(api_obj, True, "example*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   554
                    self.res_remote_wildcard)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   555
                self._search_op(api_obj, True, "/bin", self.res_remote_bin)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   556
                self._search_op(api_obj, True, "4851433",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   557
                    self.res_remote_bug_id)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   558
                self._search_op(api_obj, True, "<4851433> AND <4725245>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   559
                    self.res_remote_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   560
                self._search_op(api_obj, True, "4851433 AND 4725245",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   561
                    self.res_remote_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   562
                self._search_op(api_obj, True,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   563
                    "4851433 AND 4725245 OR example_path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   564
                    self.res_remote_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   565
                self._search_op(api_obj, True,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   566
                    "4851433 AND (4725245 OR example_path)",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   567
                    self.res_remote_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   568
                self._search_op(api_obj, True,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   569
                    "(4851433 AND 4725245) OR example_path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   570
                    self.res_remote_bug_id | self.res_remote_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   571
                self._search_op(api_obj, True, "4851433 OR 4725245",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   572
                    self.res_remote_bug_id | self.res_remote_bug_id_4725245)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   573
                self._search_op(api_obj, True, "6556919",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   574
                    self.res_remote_inc_changes)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   575
                self._search_op(api_obj, True, "6556?19",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   576
                    self.res_remote_inc_changes)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   577
                self._search_op(api_obj, True, "42",
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   578
                    self.res_remote_random_test)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   579
                self._search_op(api_obj, True, "79",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   580
                    self.res_remote_random_test_79)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   581
                self._search_op(api_obj, True, "separator",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   582
                    self.res_remote_keywords)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   583
                self._search_op(api_obj, True, "\"sort 0x86\"",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   584
                    self.res_remote_keywords_sort_phrase)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   585
                self._search_op(api_obj, True, "*example*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   586
                    self.res_remote_glob)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   587
                self._search_op(api_obj, True, "fooo", self.res_remote_foo)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   588
                self._search_op(api_obj, True, "fo*", self.res_remote_foo)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   589
                self._search_op(api_obj, True, "bar", self.res_remote_bar)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   590
                self._search_op(api_obj, True, "openssl",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   591
                    self.res_remote_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   592
                self._search_op(api_obj, True, "OPENSSL",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   593
                    self.res_remote_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   594
                self._search_op(api_obj, True, "OpEnSsL",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   595
                    self.res_remote_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   596
                self._search_op(api_obj, True, "OpEnS*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   597
                    self.res_remote_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   598
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   599
                # These tests are included because a specific bug
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   600
                # was found during development. This prevents regression back
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   601
                # to that bug. Exit status of 1 is expected because the
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   602
                # token isn't in the packages.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   603
                self._search_op(api_obj, True, "a_non_existent_token", set())
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   604
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   605
                self._search_op(api_obj, True, "42 AND 4641790", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   606
                self.assertRaises(api_errors.BooleanQueryException,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   607
                    self._search_op, api_obj, True, "<e*> AND e*", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   608
                self.assertRaises(api_errors.BooleanQueryException,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   609
                    self._search_op, api_obj, True, "e* AND <e*>", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   610
                self.assertRaises(api_errors.BooleanQueryException,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   611
                    self._search_op, api_obj, True, "<e*> OR e*", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   612
                self.assertRaises(api_errors.BooleanQueryException,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   613
                    self._search_op, api_obj, True, "e* OR <e*>", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   614
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   615
        def _run_remote_tests(self, api_obj):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   616
                # Set to 1 since searches can't currently be performed
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   617
                # package name unless it's set inside the
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   618
                # manifest which happens at install time on
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   619
                # the client side.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   620
                self._search_op(api_obj, True, "example_pkg", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   621
                self._search_op(api_obj, True, "example_path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   622
                    self.res_remote_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   623
                self._search_op(api_obj, True, "::com.sun.service.info_url:",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   624
                    self.res_remote_url)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   625
                self._search_op(api_obj, True, "<e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   626
                    self.res_remote_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   627
                self._search_op(api_obj, True, "<exam:::>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   628
                    self.res_remote_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   629
                self._search_op(api_obj, True, "exam:::e*path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   630
                    self.res_remote_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   631
                self._search_op(api_obj, True, "example*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   632
                    self.res_remote_wildcard)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   633
                self._search_op(api_obj, True, "/bin", self.res_remote_bin)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   634
                self._search_op(api_obj, True, "4851433",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   635
                    self.res_remote_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   636
                self._search_op(api_obj, True, "4725245",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   637
                    self.res_remote_bug_id_4725245)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   638
                self._search_op(api_obj, True, "6556919",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   639
                    self.res_remote_inc_changes)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   640
                self._search_op(api_obj, True, "42",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   641
                    self.res_remote_random_test)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   642
                self._search_op(api_obj, True, "79",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   643
                    self.res_remote_random_test_79)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   644
                self._search_op(api_obj, True, "separator",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   645
                    self.res_remote_keywords)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   646
                self._search_op(api_obj, True, "\"sort 0x86\"",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   647
                    self.res_remote_keywords_sort_phrase)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   648
                self._search_op(api_obj, True, "*example*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   649
                    self.res_remote_glob)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   650
                self._search_op(api_obj, True, "fooo", self.res_remote_foo)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   651
                self._search_op(api_obj, True, "bar", self.res_remote_bar)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   652
                self._search_op(api_obj, True, "OpEnSsL",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   653
                    self.res_remote_openssl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   654
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   655
                # These tests are included because a specific bug
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   656
                # was found during development. This prevents regression back
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   657
                # to that bug.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   658
                self._search_op(api_obj, True, "a_non_existent_token", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   659
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   660
        def _run_full_local_tests(self, api_obj):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   661
                outfile = os.path.join(self.testdata_dir, "res")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   662
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   663
                # This finds something because the client side
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   664
                # manifest has had the name of the package inserted
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   665
                # into it.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   666
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   667
                self._search_op(api_obj, False, "example_pkg",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   668
                    self.res_local_pkg)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   669
                self._search_op(api_obj, False, "example_path",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   670
                    self.res_local_path)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   671
                self._search_op(api_obj, False, "(example_path)",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   672
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   673
                self._search_op(api_obj, False, "<exam*:::>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   674
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   675
                self._search_op(api_obj, False, "::com.sun.service.info_url:",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   676
                    self.res_remote_url)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   677
                self._search_op(api_obj, False, ":::e* AND *path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   678
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   679
                self._search_op(api_obj, False, "e* AND *path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   680
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   681
                self._search_op(api_obj, False, "<e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   682
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   683
                self._search_op(api_obj, False, "<e*> AND <e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   684
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   685
                self._search_op(api_obj, False, "<e*> OR <e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   686
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   687
                self._search_op(api_obj, False, "<exam:::>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   688
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   689
                self._search_op(api_obj, False, "exam:::e*path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   690
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   691
                self._search_op(api_obj, False, "exam:::e*path AND e*:::",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   692
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   693
                self._search_op(api_obj, False, "e*::: AND exam:::*path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   694
                    self.res_remote_path_extra)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   695
                self._search_op(api_obj, False, "example*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   696
                    self.res_local_wildcard)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   697
                self._search_op(api_obj, False, "/bin", self.res_local_bin)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   698
                self._search_op(api_obj, False, "4851433",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   699
                    self.res_local_bug_id)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   700
                self._search_op(api_obj, False, "<4851433> AND <4725245>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   701
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   702
                self._search_op(api_obj, False, "4851433 AND 4725245",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   703
                    self.res_local_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   704
                self._search_op(api_obj, False,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   705
                    "4851433 AND 4725245 OR example_path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   706
                    self.res_local_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   707
                self._search_op(api_obj, False,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   708
                    "4851433 AND (4725245 OR example_path)",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   709
                    self.res_local_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   710
                self._search_op(api_obj, False,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   711
                    "(4851433 AND 4725245) OR example_path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   712
                    self.res_local_bug_id | self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   713
                self._search_op(api_obj, False, "4851433 OR 4725245",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   714
                    self.res_local_bug_id | self.res_remote_bug_id_4725245)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   715
                self._search_op(api_obj, False, "6556919",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   716
                    self.res_local_inc_changes)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   717
                self._search_op(api_obj, False, "65569??",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   718
                    self.res_local_inc_changes)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   719
                self._search_op(api_obj, False, "42",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   720
                    self.res_local_random_test)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   721
                self._search_op(api_obj, False, "79",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   722
                    self.res_remote_random_test_79)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   723
                self._search_op(api_obj, False, "separator",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   724
                    self.res_local_keywords)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   725
                self._search_op(api_obj, False, "\"sort 0x86\"",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   726
                    self.res_remote_keywords_sort_phrase)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   727
                self._search_op(api_obj, False, "*example*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   728
                    self.res_local_glob)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   729
                self._search_op(api_obj, False, "fooo", self.res_local_foo)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   730
                self._search_op(api_obj, False, "fo*", self.res_local_foo)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   731
                self._search_op(api_obj, False, "bar", self.res_local_bar)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   732
                self._search_op(api_obj, False, "openssl",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   733
                    self.res_local_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   734
                self._search_op(api_obj, False, "OPENSSL",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   735
                    self.res_local_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   736
                self._search_op(api_obj, False, "OpEnSsL",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   737
                    self.res_local_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   738
                self._search_op(api_obj, False, "OpEnS*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   739
                    self.res_local_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   740
                # These tests are included because a specific bug
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   741
                # was found during development. These tests prevent regression
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   742
                # back to that bug. Exit status of 1 is expected because the
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   743
                # token isn't in the packages.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   744
                self._search_op(api_obj, False, "a_non_existent_token", set())
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   745
                self._search_op(api_obj, False, "42 AND 4641790", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   746
                self.assertRaises(api_errors.BooleanQueryException,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   747
                    self._search_op, api_obj, False, "<e*> AND e*", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   748
                self.assertRaises(api_errors.BooleanQueryException,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   749
                    self._search_op, api_obj, False, "e* AND <e*>", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   750
                self.assertRaises(api_errors.BooleanQueryException,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   751
                    self._search_op, api_obj, False, "<e*> OR e*", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   752
                self.assertRaises(api_errors.BooleanQueryException,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   753
                    self._search_op, api_obj, False, "e* OR <e*>", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   754
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   755
        def _run_local_tests(self, api_obj):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   756
                outfile = os.path.join(self.testdata_dir, "res")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   757
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   758
                # This finds something because the client side
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   759
                # manifest has had the name of the package inserted
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   760
                # into it.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   761
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   762
                self._search_op(api_obj, False, "example_pkg",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   763
                    self.res_local_pkg)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   764
                self._search_op(api_obj, False, "example_path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   765
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   766
                self._search_op(api_obj, False, "::com.sun.service.info_url:",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   767
                    self.res_remote_url)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   768
                self._search_op(api_obj, False, "<e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   769
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   770
                self._search_op(api_obj, False, "<exam:::>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   771
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   772
                self._search_op(api_obj, False, "exam:::e*path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   773
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   774
                self._search_op(api_obj, False, "example*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   775
                    self.res_local_wildcard)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   776
                self._search_op(api_obj, False, "/bin", self.res_local_bin)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   777
                self._search_op(api_obj, False, "4851433",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   778
                    self.res_local_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   779
                self._search_op(api_obj, False, "4725245",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   780
                    self.res_remote_bug_id_4725245)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   781
                self._search_op(api_obj, False, "6556919",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   782
                    self.res_local_inc_changes)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   783
                self._search_op(api_obj, False, "42",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   784
                    self.res_local_random_test)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   785
                self._search_op(api_obj, False, "79",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   786
                    self.res_remote_random_test_79)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   787
                self._search_op(api_obj, False, "separator",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   788
                    self.res_local_keywords)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   789
                self._search_op(api_obj, False, "\"sort 0x86\"",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   790
                    self.res_remote_keywords_sort_phrase)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   791
                self._search_op(api_obj, False, "*example*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   792
                    self.res_local_glob)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   793
                self._search_op(api_obj, False, "fooo", self.res_local_foo)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   794
                self._search_op(api_obj, False, "bar", self.res_local_bar)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   795
                self._search_op(api_obj, False, "OpEnSsL",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   796
                    self.res_local_openssl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   797
                # These tests are included because a specific bug
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   798
                # was found during development. These tests prevent regression
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   799
                # back to that bug.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   800
                self._search_op(api_obj, False, "a_non_existent_token", set())
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   801
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   802
        def _run_degraded_local_tests(self, api_obj):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   803
                outfile = os.path.join(self.testdata_dir, "res")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   804
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   805
                # This finds something because the client side
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   806
                # manifest has had the name of the package inserted
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   807
                # into it.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   808
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   809
                self._search_op_slow(api_obj, False, "example_pkg",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   810
                    self.res_local_pkg)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   811
                self._search_op_slow(api_obj, False, "example_path",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   812
                    self.res_local_path)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   813
                self._search_op_slow(api_obj, False, "(example_path)",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   814
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   815
                self._search_op_slow(api_obj, False, "<exam*:::>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   816
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   817
                self._search_op_slow(api_obj, False,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   818
                    "::com.sun.service.info_url:",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   819
                    self.res_remote_url)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   820
                self._search_op_slow(api_obj, False, ":::e* AND *path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   821
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   822
                self._search_op_slow(api_obj, False, "e* AND *path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   823
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   824
                self._search_op_slow(api_obj, False, "<e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   825
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   826
                self._search_op_slow(api_obj, False, "<e*> AND <e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   827
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   828
                self._search_op_slow(api_obj, False, "<e*> OR <e*>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   829
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   830
                self._search_op_slow(api_obj, False, "<exam:::>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   831
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   832
                self._search_op_slow(api_obj, False, "exam:::e*path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   833
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   834
                self._search_op_slow(api_obj, False, "exam:::e*path AND e*:::",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   835
                    self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   836
                self._search_op_slow(api_obj, False, "e*::: AND exam:::*path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   837
                    self.res_remote_path_extra)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   838
                self._search_op_slow(api_obj, False, "example*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   839
                    self.res_local_wildcard)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   840
                self._search_op_slow(api_obj, False, "/bin", self.res_local_bin)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   841
                self._search_op_slow(api_obj, False, "4851433",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   842
                    self.res_local_bug_id)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   843
                self._search_op_slow(api_obj, False, "<4851433> AND <4725245>",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   844
                    self.res_local_pkg_ret_pkg, return_actions=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   845
                self._search_op_slow(api_obj, False, "4851433 AND 4725245",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   846
                    self.res_local_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   847
                self._search_op_slow(api_obj, False,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   848
                    "4851433 AND 4725245 OR example_path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   849
                    self.res_local_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   850
                self._search_op_slow(api_obj, False,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   851
                    "4851433 AND (4725245 OR example_path)",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   852
                    self.res_local_bug_id)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   853
                self._search_op_slow(api_obj, False,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   854
                    "(4851433 AND 4725245) OR example_path",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   855
                    self.res_local_bug_id | self.res_local_path)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   856
                self._search_op_slow(api_obj, False, "4851433 OR 4725245",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   857
                    self.res_local_bug_id | self.res_remote_bug_id_4725245)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   858
                self._search_op_slow(api_obj, False, "6556919",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   859
                    self.res_local_inc_changes)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   860
                self._search_op_slow(api_obj, False, "65569??",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   861
                    self.res_local_inc_changes)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   862
                self._search_op_slow(api_obj, False, "42",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   863
                    self.res_local_random_test)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   864
                self._search_op_slow(api_obj, False, "79",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   865
                    self.res_remote_random_test_79)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   866
                self._search_op_slow(api_obj, False, "separator",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   867
                    self.res_local_keywords)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   868
                self._search_op_slow(api_obj, False, "\"sort 0x86\"",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
   869
                    self.res_remote_keywords_sort_phrase)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   870
                self._search_op_slow(api_obj, False, "*example*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   871
                    self.res_local_glob)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   872
                self._search_op_slow(api_obj, False, "fooo", self.res_local_foo)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   873
                self._search_op_slow(api_obj, False, "fo*", self.res_local_foo)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   874
                self._search_op_slow(api_obj, False, "bar", self.res_local_bar)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   875
                self._search_op_slow(api_obj, False, "openssl",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   876
                    self.res_local_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   877
                self._search_op_slow(api_obj, False, "OPENSSL",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   878
                    self.res_local_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   879
                self._search_op_slow(api_obj, False, "OpEnSsL",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   880
                    self.res_local_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   881
                self._search_op_slow(api_obj, False, "OpEnS*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   882
                    self.res_local_openssl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   883
                # These tests are included because a specific bug
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   884
                # was found during development. These tests prevent regression
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   885
                # back to that bug. Exit status of 1 is expected because the
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   886
                # token isn't in the packages.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   887
                self._search_op_slow(api_obj, False, "a_non_existent_token",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   888
                    set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   889
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   890
        def _run_local_tests_example11_installed(self, api_obj):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   891
                outfile = os.path.join(self.testdata_dir, "res")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   892
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   893
                # This finds something because the client side
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   894
                # manifest has had the name of the package inserted
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   895
                # into it.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   896
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   897
                self._search_op(api_obj, False, "example_pkg",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   898
                    self.res_local_pkg_example11)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   899
                self._search_op(api_obj, False, "example_path", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   900
                self._search_op(api_obj, False, "example_path11",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   901
                    self.res_local_path_example11)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   902
                self._search_op(api_obj, False, "example*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   903
                    self.res_local_wildcard_example11)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   904
                self._search_op(api_obj, False, "/bin",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   905
                    self.res_local_bin_example11)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   906
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   907
        def _run_local_empty_tests(self, api_obj):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   908
                self._search_op(api_obj, False, "example_pkg", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   909
                self._search_op(api_obj, False, "example_path", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   910
                self._search_op(api_obj, False, "example*", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   911
                self._search_op(api_obj, False, "/bin", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   912
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   913
        def _run_remote_empty_tests(self, api_obj):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   914
                self._search_op(api_obj, True, "example_pkg", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   915
                self._search_op(api_obj, True, "example_path", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   916
                self._search_op(api_obj, True, "example*", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   917
                self._search_op(api_obj, True, "/bin", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   918
                self._search_op(api_obj, True, "*unique*", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   919
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   920
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   921
        def _restore_dir(index_dir, index_dir_tmp):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   922
                shutil.rmtree(index_dir)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   923
                shutil.move(index_dir_tmp, index_dir)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   924
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   925
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   926
        def _restore_dir_preserve_hash(index_dir, index_dir_tmp):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   927
                tmp_file = "full_fmri_list.hash"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   928
                portable.remove(os.path.join(index_dir_tmp, tmp_file))
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   929
                shutil.move(os.path.join(index_dir, tmp_file),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   930
                            index_dir_tmp)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   931
                fh = open(os.path.join(index_dir_tmp, ss.MAIN_FILE), "r")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   932
                fh.seek(0)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   933
                fh.seek(9)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   934
                ver = fh.read(1)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   935
                fh.close()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   936
                fh = open(os.path.join(index_dir_tmp, tmp_file), "r+")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   937
                fh.seek(0)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   938
                fh.seek(9)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   939
                # Overwrite the existing version number.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   940
                # By definition, the version 0 is never used.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   941
                fh.write("%s" % ver)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   942
                shutil.rmtree(index_dir)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   943
                shutil.move(index_dir_tmp, index_dir)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   944
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   945
        def _get_index_dirs(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   946
                index_dir = os.path.join(self.img_path, "var","pkg","index")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   947
                index_dir_tmp = index_dir + "TMP"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   948
                return index_dir, index_dir_tmp
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   949
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   950
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   951
        def _overwrite_version_number(file_path):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   952
                fh = open(file_path, "r+")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   953
                fh.seek(0)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   954
                fh.seek(9)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   955
                # Overwrite the existing version number.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   956
                # By definition, the version 0 is never used.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   957
                fh.write("0")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   958
                fh.close()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   959
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   960
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   961
        def _overwrite_on_disk_format_version_number(file_path):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   962
                fh = open(file_path, "r+")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   963
                fh.seek(0)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   964
                fh.seek(16)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   965
                # Overwrite the existing version number.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   966
                # By definition, the version 0 is never used.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   967
                fh.write("9")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   968
                fh.close()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   969
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   970
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   971
        def _overwrite_on_disk_format_version_number_with_letter(file_path):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   972
                fh = open(file_path, "r+")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   973
                fh.seek(0)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   974
                fh.seek(16)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   975
                # Overwrite the existing version number.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   976
                # By definition, the version 0 is never used.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   977
                fh.write("a")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   978
                fh.close()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   979
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   980
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   981
        def _replace_on_disk_format_version(dir):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   982
                file_path = os.path.join(dir, ss.BYTE_OFFSET_FILE)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   983
                fh = open(file_path, "r")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   984
                lst = fh.readlines()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   985
                fh.close()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   986
                fh = open(file_path, "w")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   987
                fh.write(lst[0])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   988
                for l in lst[2:]:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   989
                        fh.write(l)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   990
                fh.close()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   991
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   992
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   993
        def _overwrite_hash(ffh_path):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   994
                fh = open(ffh_path, "r+")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   995
                fh.seek(0)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   996
                fh.seek(20)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   997
                fh.write("*")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   998
                fh.close()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
   999
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1000
        def _check_no_index(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1001
                ind_dir, ind_dir_tmp = self._get_index_dirs()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1002
                if os.listdir(ind_dir):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1003
                        self.assert_(0)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1004
                if os.path.exists(ind_dir_tmp):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1005
                        self.assert_(0)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1006
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1007
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1008
        def _do_install(api_obj, pkg_list, **kwargs):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1009
                api_obj.plan_install(pkg_list, [], **kwargs)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1010
                TestApiSearchBasics._do_finish(api_obj)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1011
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1012
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1013
        def _do_uninstall(api_obj, pkg_list, **kwargs):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1014
                api_obj.plan_uninstall(pkg_list, False, **kwargs)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1015
                TestApiSearchBasics._do_finish(api_obj)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1016
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1017
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1018
        def _do_image_update(api_obj, **kwargs):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1019
                api_obj.plan_update_all(sys.argv[0], **kwargs)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1020
                TestApiSearchBasics._do_finish(api_obj)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1021
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1022
        @staticmethod
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1023
        def _do_finish(api_obj):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1024
                api_obj.prepare()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1025
                api_obj.execute_plan()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1026
                api_obj.reset()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1027
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1028
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1029
class TestApiSearchBasicsPersistentDepot(TestApiSearchBasics):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1030
        # Only start/stop the depot once (instead of for every test)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1031
        persistent_depot = True
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1032
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1033
        def __init__(self, *args, **kwargs):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1034
                TestApiSearchBasics.__init__(self, *args, **kwargs)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1035
                self.sent_pkgs = set()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1036
        
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1037
        def pkgsend_bulk(self, durl, pkg, optional=True):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1038
                if pkg not in self.sent_pkgs or optional == False:
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1039
                        self.sent_pkgs.add(pkg)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1040
                        TestApiSearchBasics.pkgsend_bulk(self, durl, pkg)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1041
        
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1042
        def test_010_remote(self):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1043
                """Test remote search."""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1044
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1045
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1046
                self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1047
                progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1048
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1049
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1050
                time.sleep(1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1051
                # This should be a full test to test all functionality.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1052
                self._run_full_remote_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1053
                self._search_op(api_obj, True, ":file::", self.res_remote_file)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1054
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1055
        def test_020_local_0(self):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1056
                """Install one package, and run the search suite."""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1057
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1058
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1059
                self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1060
                progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1061
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1062
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1063
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1064
                self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1065
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1066
                self._run_full_local_tests(api_obj)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1067
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1068
        def test_030_degraded_local(self):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1069
                """Install one package, and run the search suite."""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1070
                durl = self.dc.get_depot_url()
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1071
                fmris = self.pkgsend_bulk(durl, self.example_pkg10)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1072
                self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1073
                progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1074
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1075
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1076
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1077
                self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1078
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1079
                index_dir = os.path.join(self.img_path, "var","pkg","index")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1080
                shutil.rmtree(index_dir)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1081
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1082
                self._run_degraded_local_tests(api_obj)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1083
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1084
        def test_040_repeated_install_uninstall(self):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1085
                """Install and uninstall a package. Checking search both
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1086
                after each change to the image."""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1087
                # During development, the index could become corrupted by
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1088
                # repeated installing and uninstalling a package. This
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1089
                # tests if that has been fixed.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1090
                repeat = 3
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1091
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1092
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1093
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1094
                self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1095
                progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1096
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1097
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1098
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1099
                self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1100
                self._do_uninstall(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1101
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1102
                for i in range(1, repeat):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1103
                        self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1104
                        self._run_local_tests(api_obj)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1105
                        self._do_uninstall(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1106
                        api_obj.reset()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1107
                        self._run_local_empty_tests(api_obj)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1108
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1109
        def test_050_local_case_sensitive(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1110
                """Test local case sensitive search"""
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1111
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1112
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1113
                self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1114
                progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1115
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1116
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1117
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1118
                self._do_install(api_obj, ["example_pkg"])
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1119
                self._search_op(api_obj, False, "fooo", set(), True)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1120
                self._search_op(api_obj, False, "fo*", set(), True)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1121
                self._search_op(api_obj, False, "bar", set(), True)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1122
                self._search_op(api_obj, False, "FOOO", self.res_local_foo,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1123
                    True)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1124
                self._search_op(api_obj, False, "bAr", self.res_local_bar, True)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1125
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1126
        def test_060_missing_files(self):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1127
                """Test to check for stack trace when files missing.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1128
                Bug 2753"""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1129
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1130
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1131
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1132
                self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1133
                progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1134
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1135
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1136
                self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1137
                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1138
                index_dir = os.path.join(self.img_path, "var","pkg","index")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1139
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1140
                first = True
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1141
                
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1142
                for d in query_parser.TermQuery._global_data_dict.values():
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1143
                        orig_fn = d.get_file_name()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1144
                        orig_path = os.path.join(index_dir, orig_fn)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1145
                        dest_fn = orig_fn + "TMP"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1146
                        dest_path = os.path.join(index_dir, dest_fn)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1147
                        portable.rename(orig_path, dest_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1148
                        self.assertRaises(api_errors.InconsistentIndexException,
1054
9cb4a6f869af 8003 Indexing should be faster
Brock Pytlik <bpytlik@sun.com>
parents: 1009
diff changeset
  1149
                            self._search_op, api_obj, False,
9cb4a6f869af 8003 Indexing should be faster
Brock Pytlik <bpytlik@sun.com>
parents: 1009
diff changeset
  1150
                            "exam:::example_pkg", [])
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1151
                        if first:
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1152
                                # Run the shell version once to check that no
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1153
                                # stack trace happens.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1154
                                self.pkg("search -l 'exam:::example_pkg'",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1155
                                    exit=1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1156
                                first = False
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1157
                        portable.rename(dest_path, orig_path)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1158
                        self._search_op(api_obj, False, "exam:::example_pkg",
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1159
                            self.res_local_pkg)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1160
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1161
        def test_070_mismatched_versions(self):
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1162
                """Test to check for stack trace when files missing.
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1163
                Bug 2753"""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1164
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1165
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1166
                self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1167
                progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1168
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1169
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1170
                self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1171
                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1172
                index_dir = os.path.join(self.img_path, "var","pkg","index")
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1173
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1174
                first = True
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1175
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1176
                for d in query_parser.TermQuery._global_data_dict.values():
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1177
                        orig_fn = d.get_file_name()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1178
                        orig_path = os.path.join(index_dir, orig_fn)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1179
                        dest_fn = orig_fn + "TMP"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1180
                        dest_path = os.path.join(index_dir, dest_fn)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1181
                        shutil.copy(orig_path, dest_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1182
                        self._overwrite_version_number(orig_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1183
                        api_obj.reset()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1184
                        self.assertRaises(api_errors.InconsistentIndexException,
1054
9cb4a6f869af 8003 Indexing should be faster
Brock Pytlik <bpytlik@sun.com>
parents: 1009
diff changeset
  1185
                            self._search_op, api_obj, False,
9cb4a6f869af 8003 Indexing should be faster
Brock Pytlik <bpytlik@sun.com>
parents: 1009
diff changeset
  1186
                            "exam:::example_pkg", [])
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1187
                        if first:
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1188
                                # Run the shell version once to check that no
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1189
                                # stack trace happens.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1190
                                self.pkg("search -l 'exam:::example_pkg'",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1191
                                    exit=1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1192
                                first = False
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1193
                        portable.rename(dest_path, orig_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1194
                        self._search_op(api_obj, False, "example_pkg",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1195
                            self.res_local_pkg)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1196
                        self._overwrite_version_number(orig_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1197
                        self._do_uninstall(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1198
                        self._search_op(api_obj, False, "example_pkg", set())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1199
                        self._overwrite_version_number(orig_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1200
                        self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1201
                        api_obj.reset()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1202
                        self._search_op(api_obj, False, "example_pkg",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1203
                            self.res_local_pkg)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1204
                        
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1205
                ffh = ss.IndexStoreSetHash(ss.FULL_FMRI_HASH_FILE)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1206
                ffh_path = os.path.join(index_dir, ffh.get_file_name())
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1207
                dest_path = ffh_path + "TMP"
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1208
                shutil.copy(ffh_path, dest_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1209
                self._overwrite_hash(ffh_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1210
                self.assertRaises(api_errors.IncorrectIndexFileHash,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1211
                    self._search_op, api_obj, False, "example_pkg", set())
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1212
                # Run the shell version of the test to check for a stack trace.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1213
                self.pkg("search -l 'exam:::example_pkg'", exit=1)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1214
                portable.rename(dest_path, ffh_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1215
                self._search_op(api_obj, False, "example_pkg",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1216
                    self.res_local_pkg)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1217
                self._overwrite_hash(ffh_path)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1218
                self._do_uninstall(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1219
                self._search_op(api_obj, False, "example_pkg", set())
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1220
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1221
        def test_080_weird_patterns(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1222
                """Test strange patterns to ensure they're handled correctly"""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1223
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1224
                self.pkgsend_bulk(durl, self.example_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1225
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1226
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1227
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1228
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1229
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1230
                self._search_op(api_obj, True, "[*]", self.res_remote_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1231
                self._search_op(api_obj, True, "[?]", self.res_remote_mark)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1232
                self._search_op(api_obj, True, "[[]",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1233
                    self.res_remote_left_brace)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1234
                self._search_op(api_obj, True, "[]]",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1235
                    self.res_remote_right_brace)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1236
                self._search_op(api_obj, True, "FO[O]O", self.res_remote_foo)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1237
                self._search_op(api_obj, True, "FO[?O]O", self.res_remote_foo)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1238
                self._search_op(api_obj, True, "FO[*O]O", self.res_remote_foo)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1239
                self._search_op(api_obj, True, "FO[]O]O", self.res_remote_foo)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1240
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1241
        def test_090_bug_7660(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1242
                """Test that installing a package doesn't prevent searching on
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1243
                package names from working on previously installed packages."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1244
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1245
                self.pkgsend_bulk(durl, self.example_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1246
                self.pkgsend_bulk(durl, self.fat_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1247
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1248
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1249
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1250
                    progresstracker, lambda x: True, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1251
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1252
                tmp_dir = os.path.join(self.img_path, "var", "pkg", "index",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1253
                    "TMP")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1254
                self._do_install(api_obj, ["example_pkg"])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1255
                api_obj.rebuild_search_index()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1256
                self._do_install(api_obj, ["fat"])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1257
                self.assert_(not os.path.exists(tmp_dir))
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1258
                self._run_local_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1259
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1260
        def test_100_bug_6712_i386(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1261
                """Install one package, and run the search suite."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1262
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1263
                self.pkgsend_bulk(durl, self.fat_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1264
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1265
                self.image_create(durl,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1266
                    additional_args="--variant variant.arch=i386")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1267
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1268
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1269
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1270
                    progresstracker, lambda x: True, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1271
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1272
                remote = True
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1273
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1274
                self._search_op(api_obj, remote, "fat:::*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1275
                    self.res_remote_fat10_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1276
                self._do_install(api_obj, ["fat"])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1277
                remote = False
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1278
                self._search_op(api_obj, remote, "fat:::*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1279
                    self.res_local_fat10_i386_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1280
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1281
        def test_110_bug_6712_sparc(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1282
                """Install one package, and run the search suite."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1283
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1284
                self.pkgsend_bulk(durl, self.fat_pkg10)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1285
                
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1286
                self.image_create(durl,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1287
                    additional_args="--variant variant.arch=sparc")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1288
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1289
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1290
                    progresstracker, lambda x: True, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1291
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1292
                remote = True
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1293
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1294
                self._search_op(api_obj, remote, "fat:::*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1295
                    self.res_remote_fat10_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1296
                self._do_install(api_obj, ["fat"])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1297
                remote = False
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1298
                self._search_op(api_obj, remote, "fat:::*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1299
                    self.res_local_fat10_sparc_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1300
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1301
        def test_120_bug_3046(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1302
                """Checks if directories ending in / break the indexer."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1303
                # Need to move to t_api_search
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1304
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1305
                self.pkgsend_bulk(durl, self.bad_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1306
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1307
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1308
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1309
                    progresstracker, lambda x: True, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1310
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1311
                self._search_op(api_obj, True, "foo", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1312
                self._search_op(api_obj, True, "/", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1313
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1314
        def test_bug_2849(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1315
                """Checks if things with spaces break the indexer."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1316
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1317
                self.pkgsend_bulk(durl, self.space_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1318
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1319
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1320
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1321
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1322
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1323
                self._do_install(api_obj, ["space_pkg"])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1324
                time.sleep(1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1325
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1326
                self.pkgsend_bulk(durl, self.space_pkg10, optional=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1327
                api_obj.refresh(immediate=True)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1328
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1329
                self._do_install(api_obj, ["space_pkg"])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1330
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1331
                remote = False
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1332
                self._search_op(api_obj, remote, 'with', set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1333
                self._search_op(api_obj, remote, 'with*',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1334
                    self.res_space_with_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1335
                self._search_op(api_obj, remote, '*space',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1336
                    self.res_space_space_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1337
                self._search_op(api_obj, remote, 'space', set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1338
                self._search_op(api_obj, remote, 'unique_dir',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1339
                    self.res_space_unique)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1340
                remote = True
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1341
                self._search_op(api_obj, remote, 'with', set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1342
                self._search_op(api_obj, remote, 'with*',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1343
                    self.res_space_with_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1344
                self._search_op(api_obj, remote, '*space',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1345
                    self.res_space_space_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1346
                self._search_op(api_obj, remote, 'space', set())
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1146
diff changeset
  1347
                time.sleep(1)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1348
                self.pkgsend_bulk(durl, self.space_pkg10, optional=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1349
                # Need to add install of subsequent package and
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1350
                # local side search as well as remote
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1351
                self._search_op(api_obj, remote, 'with', set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1352
                self._search_op(api_obj, remote, 'with*',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1353
                    self.res_space_with_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1354
                self._search_op(api_obj, remote, '*space',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1355
                    self.res_space_space_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1356
                self._search_op(api_obj, remote, 'space', set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1357
                self._search_op(api_obj, remote, 'unique_dir',
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1358
                    self.res_space_unique)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1359
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1360
        def test_bug_2863(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1361
                """Check that disabling indexing works as expected"""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1362
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1363
                self.pkgsend_bulk(durl, self.example_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1364
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1365
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1366
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1367
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1368
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1369
                self._check_no_index()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1370
                self._do_install(api_obj, ["example_pkg"], update_index=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1371
                self._check_no_index()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1372
                api_obj.rebuild_search_index()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1373
                self._run_local_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1374
                self._do_uninstall(api_obj, ["example_pkg"], update_index=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1375
                # Running empty test because search will notice the index
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1376
                # does not match the installed packages and complain.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1377
                self.assertRaises(api_errors.IncorrectIndexFileHash,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1378
                    self._search_op, api_obj, False, "example_pkg", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1379
                api_obj.rebuild_search_index()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1380
                self._run_local_empty_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1381
                self._do_install(api_obj, ["example_pkg"])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1382
                self._run_local_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1383
                self.pkgsend_bulk(durl, self.example_pkg11)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1384
                api_obj.refresh(immediate=True)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1385
                self._do_image_update(api_obj, update_index=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1386
                # Running empty test because search will notice the index
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1387
                # does not match the installed packages and complain.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1388
                self.assertRaises(api_errors.IncorrectIndexFileHash,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1389
                    self._search_op, api_obj, False, "example_pkg", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1390
                api_obj.rebuild_search_index()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1391
                self._run_local_tests_example11_installed(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1392
                self._do_uninstall(api_obj, ["example_pkg"], update_index=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1393
                # Running empty test because search will notice the index
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1394
                # does not match the installed packages and complain.
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1395
                self.assertRaises(api_errors.IncorrectIndexFileHash,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1396
                    self._search_op, api_obj, False, "example_pkg", set())
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1397
                api_obj.rebuild_search_index()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1398
                self._run_local_empty_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1399
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1400
        def test_bug_2989_1(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1401
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1402
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1403
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1404
                for f in self._dir_restore_functions:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1405
                        self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1406
                        progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1407
                        api_obj = api.ImageInterface(self.get_img_path(),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1408
                            API_VERSION, progresstracker, lambda x: False,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1409
                            PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1410
                        api_obj.rebuild_search_index()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1411
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1412
                        index_dir, index_dir_tmp = self._get_index_dirs()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1413
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1414
                        shutil.copytree(index_dir, index_dir_tmp)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1415
                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1416
                        self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1417
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1418
                        f(index_dir, index_dir_tmp)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1419
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1420
                        self._do_uninstall(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1421
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1422
                        self.image_destroy()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1423
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1424
        def test_bug_2989_2(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1425
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1426
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1427
                self.pkgsend_bulk(durl, self.another_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1428
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1429
                for f in self._dir_restore_functions:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1430
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1431
                        self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1432
                        progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1433
                        api_obj = api.ImageInterface(self.get_img_path(),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1434
                            API_VERSION, progresstracker, lambda x: False,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1435
                            PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1436
                        self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1437
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1438
                        index_dir, index_dir_tmp = self._get_index_dirs()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1439
                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1440
                        shutil.copytree(index_dir, index_dir_tmp)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1441
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1442
                        self._do_install(api_obj, ["another_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1443
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1444
                        f(index_dir, index_dir_tmp)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1445
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1446
                        self._do_uninstall(api_obj, ["another_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1447
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1448
                        self.image_destroy()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1449
                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1450
        def test_bug_2989_3(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1451
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1452
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1453
                self.pkgsend_bulk(durl, self.example_pkg11)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1454
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1455
                for f in self._dir_restore_functions:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1456
                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1457
                        self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1458
                        progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1459
                        api_obj = api.ImageInterface(self.get_img_path(),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1460
                            API_VERSION, progresstracker, lambda x: False,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1461
                            PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1462
                        self._do_install(api_obj, ["[email protected],5.11-0"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1463
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1464
                        index_dir, index_dir_tmp = self._get_index_dirs()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1465
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1466
                        shutil.copytree(index_dir, index_dir_tmp)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1467
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1468
                        self._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1469
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1470
                        f(index_dir, index_dir_tmp)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1471
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1472
                        self._do_uninstall(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1473
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1474
                        self.image_destroy()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1475
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1476
        def test_bug_2989_4(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1477
                durl = self.dc.get_depot_url()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1478
                self.pkgsend_bulk(durl, self.another_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1479
                self.pkgsend_bulk(durl, self.example_pkg10)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1480
                self.pkgsend_bulk(durl, self.example_pkg11)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1481
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1482
                for f in self._dir_restore_functions:
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1483
                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1484
                        self.image_create(durl)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1485
                        progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1486
                        api_obj = api.ImageInterface(self.get_img_path(),
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1487
                            API_VERSION, progresstracker, lambda x: False,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1488
                            PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1489
                        self._do_install(api_obj, ["another_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1490
                
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1491
                        index_dir, index_dir_tmp = self._get_index_dirs()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1492
                        
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1493
                        shutil.copytree(index_dir, index_dir_tmp)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1494
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1495
                        self._do_install(api_obj, ["[email protected],5.11-0"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1496
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1497
                        f(index_dir, index_dir_tmp)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1498
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1499
                        self._do_image_update(api_obj)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1500
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1501
                        self.image_destroy()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1502
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1503
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1504
        def test_bug_4239(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1505
                """Tests whether categories are indexed and searched for
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1506
                correctly."""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1507
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1508
                def _run_cat_tests(self, remote):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1509
                        self._search_op(api_obj, remote, "System",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1510
                            self.res_cat_pkg10, case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1511
                        self._search_op(api_obj, remote, "Security",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1512
                            self.res_cat_pkg10, case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1513
                        self._search_op(api_obj, remote, "System/Security",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1514
                            self.res_cat_pkg10, case_sensitive=False)
1115
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1515
                        self._search_op(api_obj, remote, "Other/Category",
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1516
                            self.res_cat_pkg10_2, case_sensitive=False)
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1517
                        self._search_op(api_obj, remote, "Other",
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1518
                            self.res_cat_pkg10_2, case_sensitive=False)
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1519
                        self._search_op(api_obj, remote, "Category",
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1520
                            self.res_cat_pkg10_2, case_sensitive=False)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1521
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1522
                def _run_cat2_tests(self, remote):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1523
                        self._search_op(api_obj, remote, "Applications",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1524
                            self.res_cat2_pkg10, case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1525
                        self._search_op(api_obj, True, "Sound",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1526
                            self.res_cat2_pkg10, case_sensitive=False)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1527
                        self._search_op(api_obj, remote, "Sound and Video",
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1528
                            self.res_cat2_pkg10, case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1529
                        self._search_op(api_obj, remote, "Sound*",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1530
                            self.res_cat2_pkg10, case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1531
                        self._search_op(api_obj, remote, "*Video",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1532
                            self.res_cat2_pkg10, case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1533
                        self._search_op(api_obj, remote,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1534
                            "'Applications/Sound and Video'",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1535
                            self.res_cat2_pkg10, case_sensitive=False)
1115
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1536
                        self._search_op(api_obj, remote, "Developer/C",
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1537
                            self.res_cat2_pkg10_2, case_sensitive=False)
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1538
                        self._search_op(api_obj, remote, "Developer",
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1539
                            self.res_cat2_pkg10_2, case_sensitive=False)
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1540
                        self._search_op(api_obj, remote, "C",
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1541
                            self.res_cat2_pkg10_2, case_sensitive=False)
fae096bd02df 8865 attribute.generate_indicies doesn't handle multivalued info.category actions
Brock Pytlik <bpytlik@sun.com>
parents: 1102
diff changeset
  1542
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1543
                def _run_cat3_tests(self, remote):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1544
                        self._search_op(api_obj, remote, "foo",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1545
                            self.res_cat3_pkg10,case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1546
                        self._search_op(api_obj, remote, "baz",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1547
                            self.res_cat3_pkg10, case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1548
                        self._search_op(api_obj, remote, "asda",
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1549
                            self.res_cat3_pkg10, case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1550
                        self._search_op(api_obj, remote,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1551
                            "foo/bar/baz/bill/beam/asda", self.res_cat3_pkg10,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1552
                            case_sensitive=False)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1553
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1554
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1555
                self.pkgsend_bulk(durl, self.cat_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1556
                self.pkgsend_bulk(durl, self.cat2_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1557
                self.pkgsend_bulk(durl, self.cat3_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1558
                self.pkgsend_bulk(durl, self.bad_cat_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1559
                self.pkgsend_bulk(durl, self.bad_cat2_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1560
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1561
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1562
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1563
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1564
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1565
                remote = True
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1566
                _run_cat_tests(self, remote)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1567
                _run_cat2_tests(self, remote)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1568
                _run_cat3_tests(self, remote)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1569
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1570
                remote = False
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1571
                self._do_install(api_obj, ["cat"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1572
                _run_cat_tests(self, remote)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1573
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1574
                self._do_install(api_obj, ["cat2"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1575
                _run_cat2_tests(self, remote)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1576
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1577
                self._do_install(api_obj, ["cat3"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1578
                _run_cat3_tests(self, remote)
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1579
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1580
                self._do_install(api_obj, ["badcat"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1581
                self._do_install(api_obj, ["badcat2"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1582
                _run_cat_tests(self, remote)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1583
                _run_cat2_tests(self, remote)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1584
                _run_cat3_tests(self, remote)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1585
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1586
        def test_bug_7628(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1587
                """Checks whether incremental update generates wrong
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1588
                additional lines."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1589
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1590
                depotpath = self.dc.get_repodir()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1591
                ind_dir = os.path.join(depotpath, "index")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1592
                tok_file = os.path.join(ind_dir, ss.BYTE_OFFSET_FILE)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1593
                main_file = os.path.join(ind_dir, ss.MAIN_FILE)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1594
                self.pkgsend_bulk(durl, self.example_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1595
                time.sleep(1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1596
                fh = open(tok_file)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1597
                tok_1 = fh.readlines()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1598
                tok_len = len(tok_1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1599
                fh.close()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1600
                fh = open(main_file)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1601
                main_1 = fh.readlines()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1602
                main_len = len(main_1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1603
                self.pkgsend_bulk(durl, self.example_pkg10, optional=False)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1604
                time.sleep(1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1605
                fh = open(tok_file)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1606
                tok_2 = fh.readlines()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1607
                new_tok_len = len(tok_2)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1608
                fh.close()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1609
                fh = open(main_file)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1610
                main_2 = fh.readlines()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1611
                new_main_len = len(main_2)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1612
                fh.close()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1613
                self.assert_(new_tok_len == tok_len)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1614
                self.assert_(new_main_len == main_len)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1615
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1616
        def test_bug_983(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1617
                """Test for known bug 983."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1618
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1619
                self.pkgsend_bulk(durl, self.bug_983_manifest)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1620
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1621
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1622
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1623
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1624
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1625
                self._search_op(api_obj, True, "gmake", self.res_bug_983)
1146
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1626
                self._search_op(api_obj, True, "[email protected]",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1627
                    self.res_983_csl_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1628
                self._search_op(api_obj, True, "SUNWcsl",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1629
                    self.res_983_csl_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1630
                self._search_op(api_obj, True, "[email protected]",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1631
                    self.res_983_bar_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1632
                self._search_op(api_obj, True, "SUNWtestbar",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1633
                    self.res_983_bar_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1634
                self._search_op(api_obj, True, "[email protected]",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1635
                    self.res_983_foo_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1636
                self._search_op(api_obj, True, "SUNWtestfoo",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1637
                    self.res_983_foo_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1638
                self._search_op(api_obj, True, "depend:require:",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1639
                    self.res_983_csl_dependency | self.res_983_bar_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1640
                self._search_op(api_obj, True, "depend:incorporate:",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1641
                    self.res_983_foo_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1642
                self._search_op(api_obj, True, "depend::",
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1643
                    self.res_983_csl_dependency | self.res_983_bar_dependency |
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1644
                    self.res_983_foo_dependency)
7c10e9798405 3322 'depend' search index has a syntax all its own
Brock Pytlik <bpytlik@sun.com>
parents: 1141
diff changeset
  1645
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1646
                
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1647
class TestApiSearchBasicsRestartingDepot(TestApiSearchBasics):        
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1648
        def setUp(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1649
                self.debug_features = ["headers"]
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1650
                TestApiSearchBasics.setUp(self)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1651
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1652
        def test_local_image_update(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1653
                """Test that the index gets updated by image-update and
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1654
                that rebuilding the index works after updating the
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1655
                image. Specifically, this tests that rebuilding indexes with
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1656
                gaps in them works correctly."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1657
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1658
                self.pkgsend_bulk(durl, self.example_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1659
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1660
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1661
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1662
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1663
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1664
                self._do_install(api_obj, ["example_pkg"])
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1665
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1666
                self.pkgsend_bulk(durl, self.example_pkg11)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1667
                api_obj.refresh(immediate=True)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1668
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1669
                self._do_image_update(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1670
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1671
                self._run_local_tests_example11_installed(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1672
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1673
                api_obj.rebuild_search_index()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1674
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1675
                self._run_local_tests_example11_installed(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1676
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1677
        def test_bug_4048_1(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1678
                """Checks whether the server deals with partial indexing."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1679
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1680
                depotpath = self.dc.get_repodir()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1681
                tmp_dir = os.path.join(depotpath, "index", "TMP")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1682
                os.mkdir(tmp_dir)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1683
                self.pkgsend_bulk(durl, self.example_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1684
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1685
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1686
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1687
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1688
                self._run_remote_empty_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1689
                os.rmdir(tmp_dir)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1690
                offset = 2
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1691
                depot_logfile = os.path.join(self.get_test_prefix(),
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1692
                    self.id(), "depot_logfile%d" % offset)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1693
                tmp_dc = self.start_depot(12000 + offset, depotpath,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1694
                    depot_logfile, refresh_index=True)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1695
                time.sleep(1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1696
                # This should do something other than sleep for 1 sec
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1697
                self._run_remote_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1698
                tmp_dc.kill()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1699
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1700
        def test_bug_4048_2(self):
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1701
                """Checks whether the server deals with partial indexing."""
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1702
                durl = self.dc.get_depot_url()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1703
                depotpath = self.dc.get_repodir()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1704
                tmp_dir = os.path.join(depotpath, "index", "TMP")
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1705
                os.mkdir(tmp_dir)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1706
                self.pkgsend_bulk(durl, self.space_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1707
                self.image_create(durl)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1708
                progresstracker = progress.NullProgressTracker()
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1709
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1710
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1711
                self._run_remote_empty_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1712
                os.rmdir(tmp_dir)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1713
                self.pkgsend_bulk(durl, self.example_pkg10)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1714
                time.sleep(1)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1715
                self._run_remote_tests(api_obj)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1716
                self._search_op(api_obj, True, "unique_dir",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1717
                    self.res_space_unique)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1718
                self._search_op(api_obj, True, "with*",
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1719
                    self.res_space_with_star)
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1720
1009
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1721
        def __corrupt_depot(self, ind_dir):
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1722
                self.dc.stop()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1723
                if os.path.exists(os.path.join(ind_dir, ss.MAIN_FILE)):
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1724
                        shutil.move(os.path.join(ind_dir, ss.MAIN_FILE),
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1725
                            os.path.join(ind_dir, "main_dict.ascii.v1"))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1726
                self.dc.start()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1727
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1728
        def __wait_for_indexing(self, d):
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1729
                init_time = time.time()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1730
                there = True
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1731
                while there and ((time.time() - init_time) < 10):
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1732
                        there = os.path.exists(d)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1733
                self.assert_(not there)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1734
                time.sleep(1)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1735
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1736
        def test_bug_7358_1(self):
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1737
                """Move files so that an inconsistent index is created and
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1738
                check that the server rebuilds the index when possible, and
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1739
                doesn't stack trace when it can't write to the directory."""
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1740
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1741
                durl = self.dc.get_depot_url()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1742
                depotpath = self.dc.get_repodir()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1743
                ind_dir = os.path.join(depotpath, "index")
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1744
                self.image_create(durl)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1745
                progresstracker = progress.NullProgressTracker()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1746
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1747
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1748
                # Check when depot is empty.
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1749
                self.__corrupt_depot(ind_dir)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1750
                self.__wait_for_indexing(os.path.join(ind_dir, "TMP"))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1751
                # Since the depot is empty, should return no results but
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1752
                # not error.
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1753
                self._search_op(api_obj, True, 'e*', set())
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1754
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1755
                self.pkgsend_bulk(durl, self.example_pkg10)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1756
                self.__wait_for_indexing(os.path.join(ind_dir, "TMP"))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1757
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1758
                # Check when depot contains a package.
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1759
                self.__corrupt_depot(ind_dir)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1760
                self.__wait_for_indexing(os.path.join(ind_dir, "TMP"))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1761
                self._run_remote_tests(api_obj)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1762
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1763
        def test_bug_7358_2(self):
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1764
                """Does same check as 7358_1 except it checks for interactions
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1765
                with writable root."""
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1766
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1767
                durl = self.dc.get_depot_url()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1768
                depotpath = self.dc.get_repodir()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1769
                ind_dir = os.path.join(depotpath, "index")
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1770
                shutil.rmtree(ind_dir)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1771
                writable_root = os.path.join(self.get_test_prefix(),
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1772
                    "writ_root")
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1773
                writ_dir = os.path.join(writable_root, "index")
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1774
                self.dc.set_writable_root(writable_root)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1775
                
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1776
                self.image_create(durl)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1777
                progresstracker = progress.NullProgressTracker()
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1778
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1779
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1780
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1781
                # Check when depot is empty.
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1782
                self.__corrupt_depot(writ_dir)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1783
                # Since the depot is empty, should return no results but
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1784
                # not error.
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1785
                self.assert_(not os.path.isdir(ind_dir))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1786
                self.__wait_for_indexing(os.path.join(writ_dir, "TMP"))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1787
                self._search_op(api_obj, True, 'e*', set())
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1788
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1789
                self.pkgsend_bulk(durl, self.example_pkg10)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1790
                self.__wait_for_indexing(os.path.join(writ_dir, "TMP"))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1791
                
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1792
                # Check when depot contains a package.
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1793
                self.__corrupt_depot(writ_dir)
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1794
                self.__wait_for_indexing(os.path.join(writ_dir, "TMP"))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1795
                self.assert_(not os.path.isdir(ind_dir))
01f531556b53 7358 Depot throws a stack trace when started with an old index (should rebuild)
Brock Pytlik <bpytlik@sun.com>
parents: 996
diff changeset
  1796
                self._run_remote_tests(api_obj)
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1797
                
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1798
        def test_bug_8318(self):
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1799
                durl = self.dc.get_depot_url()
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1800
                self.pkgsend_bulk(durl, self.example_pkg10)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1801
                self.image_create(durl)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1802
                progresstracker = progress.NullProgressTracker()
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1803
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1804
                    progresstracker, lambda x: True, PKG_CLIENT_NAME)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1805
                uuids = []
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1806
                for p in api_obj.img.gen_publishers():
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1807
                        uuids.append(p.client_uuid)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1808
                
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1809
                self._search_op(api_obj, True, "example_path",
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1810
                    self.res_remote_path)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1811
                self._search_op(api_obj, True, "example_path",
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1812
                    self.res_remote_path, servers=[{"origin": durl}])
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1813
                lfh = file(self.dc.get_logpath(), "rb")
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1814
                found = 0
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1146
diff changeset
  1815
                num_expected = 6
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1816
                for line in lfh:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1817
                        if "X-IPKG-UUID:" in line:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1818
                                tmp = line.split()
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1819
                                s_uuid = tmp[1]
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1820
                                if s_uuid not in uuids:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1821
                                        raise RuntimeError("Uuid found:%s not "
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1822
                                            "found in list of possible "
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1823
                                            "uuids:%s" % (s_uuid, uuids))
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1824
                                found += 1
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1825
                if found != num_expected:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1826
                        raise RuntimeError(("Found %s instances of a "
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1827
                            "client uuid, expected to find %s.") %
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1828
                            (found, num_expected))
1127
69d88cfd7f9e 7314 Refactor t_pkg_search
Brock Pytlik <bpytlik@sun.com>
parents: 1115
diff changeset
  1829
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1830
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1831
class TestApiSearchMulti(testutils.ManyDepotTestCase):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1832
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1833
        example_pkg10 = """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1834
            open [email protected],5.11-0
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1835
            close """
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1836
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1837
        def setUp(self):
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1838
                testutils.ManyDepotTestCase.setUp(self, 3,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1839
                    debug_features=["headers"])
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1840
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1841
                self.durl1 = self.dcs[1].get_depot_url()
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1842
                self.durl2 = self.dcs[2].get_depot_url()
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1843
                self.durl3 = self.dcs[3].get_depot_url()
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1844
                self.pkgsend_bulk(self.durl2, self.example_pkg10)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1845
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1846
                self.image_create(self.durl1, prefix = "test1")
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1847
                self.pkg("set-publisher -O " + self.durl2 + " test2")
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1848
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1849
        def _check(self, proposed_answer, correct_answer):
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1850
                if correct_answer == proposed_answer:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1851
                        return True
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1852
                else:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1853
                        self.debug("Proposed Answer: " + str(proposed_answer))
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1854
                        self.debug("Correct Answer : " + str(correct_answer))
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1855
                        if isinstance(correct_answer, set) and \
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1856
                            isinstance(proposed_answer, set):
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1857
                                print >> sys.stderr, "Missing: " + \
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1858
                                    str(correct_answer - proposed_answer)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1859
                                print >> sys.stderr, "Extra  : " + \
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1860
                                    str(proposed_answer - correct_answer)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1861
                        self.assert_(correct_answer == proposed_answer)
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1862
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1863
        @staticmethod
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1864
        def _extract_action_from_res(it):
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1865
                return (
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1866
                    (fmri.PkgFmri(str(pkg_name)).get_short_fmri(), piece,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1867
                    TestApiSearchBasics._replace_act(act))
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1868
                    for query_num, auth, (version, return_type,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1869
                    (pkg_name, piece, act))
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1870
                    in it
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1871
                )
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1872
                        
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1873
        def _search_op(self, api_obj, remote, token, test_value,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1874
            case_sensitive=False, return_actions=True, num_to_return=None,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1875
            start_point=None, servers=None):
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1876
                search_func = api_obj.local_search
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1877
                if remote:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1878
                        search_func = api_obj.remote_search
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1879
                query = api.Query(token, case_sensitive, return_actions,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1880
                    num_to_return, start_point)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1881
                res = set(self._extract_action_from_res(search_func([query],
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1882
                    servers=servers)))
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1883
                self._check(set(res), test_value)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1884
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1885
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1886
        def test_bug_2955(self):
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1887
                """See http://defect.opensolaris.org/bz/show_bug.cgi?id=2955"""
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1888
                progresstracker = progress.NullProgressTracker()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1889
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1890
                    progresstracker, lambda x: False, PKG_CLIENT_NAME)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1891
                TestApiSearchBasics._do_install(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1892
                api_obj.rebuild_search_index()
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1893
                TestApiSearchBasics._do_uninstall(api_obj, ["example_pkg"])
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1894
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1895
        def test_bug_8318(self):
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1896
                progresstracker = progress.NullProgressTracker()
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1897
                api_obj = api.ImageInterface(self.get_img_path(), API_VERSION,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1898
                    progresstracker, lambda x: True, PKG_CLIENT_NAME)
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1899
                
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1900
                self._search_op(api_obj, True,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1901
                    "this_should_not_match_any_token", set())
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1902
                self._search_op(api_obj, True, "example_path",
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1903
                    set(), servers=[{"origin": self.durl1}])
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1904
                self._search_op(api_obj, True, "example_path",
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1905
                    set(), servers=[{"origin": self.durl3}])
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1146
diff changeset
  1906
                num_expected = { 1: 7, 2: 3, 3: 0 }
1081
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1907
                for d in range(1,(len(self.dcs) + 1)):
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1908
                        try:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1909
                                pub = api_obj.img.get_publisher(
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1910
                                    origin=self.dcs[d].get_depot_url())
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1911
                                c_uuid = pub.client_uuid
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1912
                        except api_errors.UnknownPublisher:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1913
                                c_uuid = None
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1914
                        lfh = file(self.dcs[d].get_logpath(), "rb")
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1915
                        found = 0
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1916
                        for line in lfh:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1917
                                if "X-IPKG-UUID:" in line:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1918
                                        tmp = line.split()
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1919
                                        s_uuid = tmp[1]
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1920
                                        if s_uuid != c_uuid:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1921
                                                raise RuntimeError(
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1922
                                                    "Found uuid:%s doesn't "
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1923
                                                    "match expected uuid:%s, "
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1924
                                                    "d:%s, durl:%s" %
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1925
                                                    (s_uuid, c_uuid, d,
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1926
                                                    self.dcs[d].get_depot_url()))
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1927
                                        found += 1
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1928
                        if found != num_expected[d]:
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1929
                                raise RuntimeError("d:%s, found %s instances of"
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1930
                                    " a client uuid, expected to find %s." %
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1931
                                    (d, found, num_expected[d]))
0cc3e524ea7f 8318 search v1 not sending uuid
Brock Pytlik <bpytlik@sun.com>
parents: 1054
diff changeset
  1932
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1933
if __name__ == "__main__":
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents:
diff changeset
  1934
        unittest.main()