1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 
  22 #
  23 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 
  27 #
  28 # Test integer property type
  29 #
  30 001:common_name:template:DEFAULT:C,Default template name
  31 001:pg_pattern:template:DEFAULT:name=foo001,type=framework,target=this,required=true
  32 001:prop_pattern:pg_pattern:foo001:name=foo_prop001,type=integer,required=true
  33 001:property_group:service:DEFAULT:name=foo001,type=framework
  34 001:create_default_instance:service:DEFAULT:false
  35 001:valid:propval:property_group:foo001:name=foo_prop001,type=integer,value=10
  36 001:invalid:SCF_TERR_WRONG_PROP_TYPE:propval:property_group:foo001:name=foo_prop001,type=astring,value=fooval
  37 
  38 #
  39 # Test pg_pattern thats required but doesn't exist
  40 #
  41 002:common_name:template:DEFAULT:C,Default template name
  42 002:pg_pattern:template:DEFAULT:name=foo002,type=framework,target=this,required=true
  43 002:create_default_instance:service:DEFAULT:false
  44 002:valid:property_group:service:DEFAULT:name=foo002,type=framework
  45 002:invalid:SCF_TERR_MISSING_PG:property_group:service:DEFAULT:name=bar,type=framework
  46 
  47 #
  48 # Test prop_pattern that is required but doesn't exist
  49 #
  50 003:common_name:template:DEFAULT:C,Default template name
  51 003:pg_pattern:template:DEFAULT:name=foo003,type=framework,target=this,required=true
  52 003:prop_pattern:pg_pattern:foo003:name=foo_prop003,type=astring,required=true
  53 003:property_group:service:DEFAULT:name=foo003,type=framework
  54 003:create_default_instance:service:DEFAULT:false
  55 003:valid:propval:property_group:foo003:name=foo_prop003,type=astring,value=fooval
  56 003:invalid:SCF_TERR_MISSING_PROP:propval:property_group:foo003:name=bar_prop,type=astring,value=fooval
  57 
  58 #
  59 # Test pg_pattern type match and mismatch
  60 #
  61 004:common_name:template:DEFAULT:C,Default template name
  62 004:pg_pattern:template:DEFAULT:name=foo004,type=framework,target=this,required=false
  63 004:create_default_instance:service:DEFAULT:false
  64 004:valid:property_group:service:DEFAULT:name=foo004,type=framework
  65 004:invalid:SCF_TERR_WRONG_PG_TYPE:property_group:service:DEFAULT:name=foo004,type=application
  66 
  67 #
  68 # Test cardinality validity
  69 #
  70 005:common_name:template:DEFAULT:C,Default template name
  71 005:pg_pattern:template:DEFAULT:name=foo005,type=framework,target=this,required=true
  72 005:prop_pattern:pg_pattern:foo005:name=foo_prop005,type=astring,required=true
  73 005:cardinality:prop_pattern:foo_prop005:min=2,max=4
  74 005:property_group:service:DEFAULT:name=foo005,type=framework
  75 005:property:property_group:foo005:name=foo_prop005,type=astring
  76 005:create_default_instance:service:DEFAULT:false
  77 005:valid:astring_list:property:foo_prop005:foo1,foo2,foo3
  78 005:invalid:SCF_TERR_CARDINALITY_VIOLATION:astring_list:property:foo_prop005:foo1
  79 
  80 #
  81 # Test constraints ranges
  82 #
  83 006:common_name:template:DEFAULT:C,Default template name
  84 006:pg_pattern:template:DEFAULT:name=foo006,type=framework,target=this,required=true
  85 006:prop_pattern:pg_pattern:foo006:name=foo_prop006,type=integer,required=true
  86 006:constraints:prop_pattern:foo_prop006:ident=foo_prop_constraints006
  87 006:range:constraints:foo_prop_constraints006:min=5,max=200
  88 006:property_group:service:DEFAULT:name=foo006,type=framework
  89 006:create_default_instance:service:DEFAULT:false
  90 006:valid:propval:property_group:foo006:name=foo_prop006,type=integer,value=10
  91 006:invalid:SCF_TERR_RANGE_VIOLATION:propval:property_group:foo006:name=foo_prop006,type=integer,value=3
  92 
  93 #
  94 # Test constraints values
  95 #
  96 007:common_name:template:DEFAULT:C,Default template name
  97 007:pg_pattern:template:DEFAULT:name=foo007,type=framework,target=this,required=true
  98 007:prop_pattern:pg_pattern:foo007:name=foo_prop007,type=astring,required=true
  99 007:constraints:prop_pattern:foo_prop007:ident=foo_prop_constraints007
 100 007:value:constraints:foo_prop_constraints007:name=constraint_1
 101 007:value:constraints:foo_prop_constraints007:name=constraint_2
 102 007:value:constraints:foo_prop_constraints007:name=constraint_3
 103 007:property_group:service:DEFAULT:name=foo007,type=framework
 104 007:create_default_instance:service:DEFAULT:false
 105 007:valid:propval:property_group:foo007:name=foo_prop007,type=astring,value=constraint_1
 106 007:invalid:SCF_TERR_VALUE_CONSTRAINT_VIOLATED:propval:property_group:foo007:name=foo_prop007,type=astring,value=bogus