
    Hgk                        d dl Z d dlZd dlZd dlZd dlmZmZmZmZm	Z	m
Z
mZmZ d dlmZ d dlmZ ej                            dg d          d             Zej                            dg d	          d
             Zej                            dg d          d             Zej                            dddg          d             Zej                            d ed          g ddf ed          g ddf edd          g ddf ed          g ddf edd          g ddfg          d             Zd Zej                            d d!ed"fd#ed"fd$ed"fd%ed&fd'e	d"fd(e
d"fd)ed"fg          d*             Zej                            d+g d,          d-             Zd. Zej                            d/d0                    d1                    d2             Zd3 Zd4 Zd5 Z ej                            d6 ed#7           ed#7          d8f ed#7           ed#d9:          d8f ed)7           ed)7          d8f ed)7           e            d8f ed)7           ed)d9:          d;f ed%d9:           ed9<          d8fg          d=ed>ed?e!fd@            Z"ej                            dAg dB          dC             Z#ej                            dDg dE          dF             Z$dG Z%dH Z&dI Z'ej                            dJdKdLdMdNdOdPdQdRdSdTdU ej(        dV          fdWdXdYdZ ej(        d[          fd\d] ej(        d^          fd_ ej(        d`          fda ej(        db          fdcdddedfg          dg             Z)dS )h    N)HostPlacementSpecPlacementSpecServiceSpecRGWSpecNFSServiceSpecIscsiServiceSpecAlertManagerSpecCustomContainerSpec)DriveGroupSpec)SpecValidationErrorz$test_input,expected, require_network)
)myhost)r    r   F)zmyhost=sname)r   r   snameF)zmyhost:10.1.1.10)r   	10.1.1.10r   T)zmyhost:10.1.1.10=sname)r   r   r   T)zmyhost:10.1.1.0/32)r   10.1.1.0/32r   T)zmyhost:10.1.1.0/32=sname)r   r   r   T)myhost:[v1:10.1.1.10:6789])r   [v1:10.1.1.10:6789]r   T)z myhost:[v1:10.1.1.10:6789]=sname)r   r   r   T)z,myhost:[v1:10.1.1.10:6789,v2:10.1.1.11:3000])r   %[v1:10.1.1.10:6789,v2:10.1.1.11:3000]r   T)z2myhost:[v1:10.1.1.10:6789,v2:10.1.1.11:3000]=sname)r   r   r   Tc                    t          j        | |          }||k    sJ t          |          | k    sJ t          j        |           }|                                | k    sJ |t          j        |                                          k    sJ |t          j        |j        |j        |j	        d          k    sJ |t          j        |
                                          k    sJ d S )N)require_network)hostnamenetworkname)r   parsestrr   from_string
pretty_str	from_jsonr   r   r   to_json)
test_inputexpectedr   retpss        >/usr/lib/python3/dist-packages/ceph/tests/test_service_spec.pytest_parse_host_placement_specsr%      s     
!*o
N
N
NC(????s88z!!!!		":	.	.B==??j((((*2==??;;;;;; #-{H/
 /
       #-ckkmm<<<<<<<<    ztest_input,expected))r   zPlacementSpec())zcount:2zPlacementSpec(count=2))3zPlacementSpec(count=3))zhost1 host2PlacementSpec(hosts=[HostPlacementSpec(hostname='host1', network='', name=''), HostPlacementSpec(hostname='host2', network='', name='')]))zhost1;host2r(   )zhost1,host2r(   )zhost1 host2=bzPlacementSpec(hosts=[HostPlacementSpec(hostname='host1', network='', name=''), HostPlacementSpec(hostname='host2', network='', name='b')]))zhost1=a host2=bzPlacementSpec(hosts=[HostPlacementSpec(hostname='host1', network='', name='a'), HostPlacementSpec(hostname='host2', network='', name='b')]))zhost1:1.2.3.4=a host2:1.2.3.5=bzPlacementSpec(hosts=[HostPlacementSpec(hostname='host1', network='1.2.3.4', name='a'), HostPlacementSpec(hostname='host2', network='1.2.3.5', name='b')]))r   zcPlacementSpec(hosts=[HostPlacementSpec(hostname='myhost', network='[v1:10.1.1.10:6789]', name='')]))z2 host1 host2zPlacementSpec(count=2, hosts=[HostPlacementSpec(hostname='host1', network='', name=''), HostPlacementSpec(hostname='host2', network='', name='')]))z	label:foozPlacementSpec(label='foo'))z3 label:fooz#PlacementSpec(count=3, label='foo'))*zVPlacementSpec(host_pattern=HostPattern(pattern='*', pattern_type=PatternType.fnmatch)))z3 data[1-3]zgPlacementSpec(count=3, host_pattern=HostPattern(pattern='data[1-3]', pattern_type=PatternType.fnmatch)))z3 data?zcPlacementSpec(count=3, host_pattern=HostPattern(pattern='data?', pattern_type=PatternType.fnmatch)))z3 data*zcPlacementSpec(count=3, host_pattern=HostPattern(pattern='data*', pattern_type=PatternType.fnmatch)))zcount-per-host:4 label:fooz,PlacementSpec(count_per_host=4, label='foo'))zregex:Foo[0-9]|Bar[0-9]zdPlacementSpec(host_pattern=HostPattern(pattern='Foo[0-9]|Bar[0-9]', pattern_type=PatternType.regex)))z3 regex:Foo[0-9]|Bar[0-9]zmPlacementSpec(count=3, host_pattern=HostPattern(pattern='Foo[0-9]|Bar[0-9]', pattern_type=PatternType.regex))c                     t          j        |           }t          |          |k    sJ t          j        |                                          |k    s#J d|                                 d|  d            d S )N"z" != ")r   r   r   r   )r    r!   r"   s      r$   test_parse_placement_specsr,   .   s~    2 
#J
/
/Cs88x$S^^%5%566#===?h3>>CSCS?h?h[e?h?h?h=====r&   r    )zhost=a host*zhost=a label:wrongzhost? host*zhost? regex:host*zregex:host? host*zregex:host? regex:host*zhost=a count-per-host:0zhost=a count-per-host:-10zcount:2 count-per-host:1z host1=a host2=b count-per-host:2zhost1:10/8 count-per-host:2zcount-per-host:2c                     t          j        t                    5  t          j        |            d d d            d S # 1 swxY w Y   d S N)pytestraisesr   r   r   r    s    r$   !test_parse_placement_specs_raisesr2   K   s    $ 
*	+	+ . .!*---. . . . . . . . . . . . . . . . . .   <A A zmyhost:1.1.1.1/24zmyhost:1c                     t          j        t                    5  t          j        |            d d d            d S # 1 swxY w Y   d S r.   )r/   r0   
ValueErrorr   r   r1   s    r$   3test_parse_host_placement_specs_raises_wrong_formatr6   `   s     
z	"	" , ,
+++, , , , , , , , , , , , , , , , , ,r3   zp,hosts,size   )count)host1host2host3host4host5r)   )host_pattern      )count_per_hostr>   
   zfoo*)foo1foo2bar1bar2   c                 P    |                      d |D                       |k    sJ d S )Nc                 0    g | ]}t          |d d           S )r   )r   ).0ns     r$   
<listcomp>z.test_placement_target_size.<locals>.<listcomp>   s%    555!	1b"	%	%555r&   )get_target_count)phostssizes      r$   test_placement_target_sizerQ   k   sI    < 55u555 	     r&   c                     || t          dg          d}| dk    rn6| dk    rd|d<   d|d<   d|d<   n | d	k    r
d
ddii|d<   n| dk    r
d|d<   d|d<   |S )Nzhost1:1.1.1.1)rO   )
service_idservice_type	placementnfsiscsipoolapi_userapi_passwordosddata_devicesallTspecrgwrealm	rgw_realmzonergw_zone)dict)s_types_id	dict_specs      r$   _get_dict_specrh      s    ()))	 I 	7		"	& *	*$2	.!!	5t
	&
 
5!(	+ &	*r&   zs_type,o_spec,s_idmgrtestmonmdsr_   z
realm.zonerV   rW   r[   c                    t          j        t          | |                    }t          ||          sJ t          |j        t
                    sJ t          |j        j        d         t                    sJ |j        j        d         j        dk    sJ |j        j        d         j	        dk    sJ |j        j        d         j
        dk    sJ |                                J t          j        |                                           d S )Nr   r9   z1.1.1.1r   )r   r   rh   
isinstancerU   r   rO   r   r   r   r   validater   )re   o_specrf   r^   s       r$   test_servicespec_map_testrq      s      !=!=>>DdF#####dnm44444dn*1-/@AAAAA>"+w6666>"*i7777>"'2----==??"""$,,..)))))r&   z0realm, zone, frontend_type, raise_exception, msg))r`   zone1beastFr   )r`   zone2civetwebFr   )r`   Nrs   Tz5Cannot add RGW: Realm specified but no zone specified)Nrr   rs   Tz5Cannot add RGW: Zone specified but no realm specified)r`   rb   zinvalid-beastT ^Invalid rgw_frontend_type value)r`   rb   zinvalid-civetwebTrv   c                     t          d| ||          }|rJt          j        t          |          5  |                                 d d d            d S # 1 swxY w Y   d S |                                 d S )Nfoo)rS   ra   rc   rgw_frontend_type)match)r   r/   r0   r   ro   )r`   rb   frontend_typeraise_exceptionmsgr^   s         r$   test_rgw_servicespec_parser~      s     e" %24 4 4D  ].c::: 	 	MMOOO	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   AAAc                  j    ddidddddidd	d
dd} t          j        |           }|j        dk    sJ d S )Nr>   r)   zall-available-deviceszosd.all-available-devicesr[   r]   TAND	bluestore)r\   filter_logicobjectstore)rU   rS   service_namerT   r^   	unmanaged)r   r   r   )osd_specdg_specs     r$   test_osd_unmanagedr      s`    ,c25 ; %*/^ijj!# #H #H--G$$$$$$r&   yaZ  service_type: crash
service_name: crash
placement:
  host_pattern: '*'
---
service_type: crash
service_name: crash
placement:
  host_pattern: '*'
unmanaged: true
---
service_type: crash
service_name: crash
placement:
  host_pattern:
    pattern: Foo[0-9]|Bar[0-9]
    pattern_type: regex
---
service_type: rgw
service_id: default-rgw-realm.eu-central-1.1
service_name: rgw.default-rgw-realm.eu-central-1.1
placement:
  hosts:
  - ceph-001
networks:
- 10.0.0.0/8
- 192.168.0.0/16
spec:
  rgw_frontend_type: civetweb
  rgw_realm: default-rgw-realm
  rgw_zone: eu-central-1
---
service_type: osd
service_id: osd_spec_default
service_name: osd.osd_spec_default
placement:
  host_pattern: '*'
spec:
  data_devices:
    model: MC-55-44-XZ
  db_devices:
    model: SSD-123-foo
  filter_logic: AND
  objectstore: bluestore
  wal_devices:
    model: NVME-QQQQ-987
---
service_type: alertmanager
service_name: alertmanager
spec:
  port: 1234
  user_data:
    default_webhook_urls:
    - foo
---
service_type: grafana
service_name: grafana
spec:
  anonymous_access: true
  port: 1234
---
service_type: grafana
service_name: grafana
spec:
  anonymous_access: true
  initial_admin_password: secure
  port: 1234
---
service_type: ingress
service_id: rgw.foo
service_name: ingress.rgw.foo
placement:
  hosts:
  - host1
  - host2
  - host3
spec:
  backend_service: rgw.foo
  first_virtual_router_id: 50
  frontend_port: 8080
  monitor_port: 8081
  virtual_ip: 192.168.20.1/24
---
service_type: nfs
service_id: mynfs
service_name: nfs.mynfs
spec:
  port: 1234
---
service_type: iscsi
service_id: iscsi
service_name: iscsi.iscsi
networks:
- ::0/8
spec:
  api_password: admin
  api_port: 5000
  api_user: admin
  pool: pool
  trusted_ip_list:
  - ::1
  - ::2
---
service_type: container
service_id: hello-world
service_name: container.hello-world
spec:
  args:
  - --foo
  bind_mounts:
  - - type=bind
    - source=lib/modules
    - destination=/lib/modules
    - ro=true
  dirs:
  - foo
  - bar
  entrypoint: /usr/bin/bash
  envs:
  - FOO=0815
  files:
    bar.conf:
    - foo
    - bar
    foo.conf: 'foo

      bar'
  gid: 2000
  image: docker.io/library/hello-world:latest
  ports:
  - 8080
  - 8443
  uid: 1000
  volume_mounts:
    foo: /foo
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_community: public
  snmp_destination: 192.168.1.42:162
  snmp_version: V2c
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  auth_protocol: MD5
  credentials:
    snmp_v3_auth_password: mypassword
    snmp_v3_auth_username: myuser
  engine_id: 8000C53F00000000
  port: 9464
  snmp_destination: 192.168.1.42:162
  snmp_version: V3
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_password: mypassword
    snmp_v3_auth_username: myuser
    snmp_v3_priv_password: mysecret
  engine_id: 8000C53F00000000
  privacy_protocol: AES
  snmp_destination: 192.168.1.42:162
  snmp_version: V3
---
service_type: grafana
service_name: grafana
placement:
  count: 1
spec:
  anonymous_access: false
  initial_admin_password: password
z---
c                    t          j        |           }t          j        |          }t          j        |          | k    sJ t          j        t          j        |                                                    | k    sJ d S r.   )yaml	safe_loadr   r   dumpr   )r   dataobjects      r$   	test_yamlr      su    p >!D"4((F9V!!!!9[*6>>+;+;<<==BBBBBBr&   c                     t                      } | j        dk    sJ t          | j        t                    sJ t          | j                                                  dk    sJ |                                 ddgk    sJ d S )Nalertmanagerr   i#  i#  )r	   rT   rn   	user_datard   lenkeysget_port_startr^   s    r$   test_alertmanager_spec_1r     s    D....dnd+++++t~""$$%%****  T4L000000r&   c                      t          ddgi          } t          | j        t                    sJ d| j                                        v sJ d S )Ndefault_webhook_urlsrx   )r   )r	   rn   r   rd   r   r   s    r$   test_alertmanager_spec_2r     sW    '=w&GHHHDdnd+++++!T^%8%8%:%:::::::r&   c                  l    d} t          |           }|j        dk    sJ | t          |          k    sJ d S )NzlServiceSpec.from_json(yaml.safe_load('''service_type: crash
service_name: crash
placement:
  count: 42
'''))crash)evalrT   repr)valobjs     r$   	test_reprr     sG    	C
 s))Cw&&&&$s))r&   zspec1, spec2, eq)rT   Trx   )rT   rS   F)rS   spec1spec2eqc                     | |k    |u sJ d S r.    )r   r   r   s      r$   test_spec_hash_eqr     s     z UNr!!!!!!r&   zs_type,s_id,s_name))ri   rf   ri   )rk   rf   rk   )rl   rf   zmds.s_id)r_   rf   zrgw.s_id)rV   rf   znfs.s_id)rW   rf   z
iscsi.s_id)r[   rf   zosd.s_idc                     t          j        t          | |                    }|                                 |                                |k    sJ d S r.   )r   r   rh   ro   r   )re   rf   s_namer^   s       r$   test_service_namer     sN      !=!=>>DMMOOO&((((((r&   zs_type,s_id))rl   zs:id)rl   1abc)rl   r   )r_   z*s_id)rV   zs/id)rW   zs@id)r[   zs;idc                     t          j        t                    5  t          j        t          | |                    }|                                 d d d            d S # 1 swxY w Y   d S r.   )r/   r0   r   r   r   rh   ro   )re   rf   r^   s      r$   #test_service_id_raises_invalid_charr     s     
*	+	+  $^FD%A%ABB                 s   7AA"%A"c                     t          dddddddidgd	gg d
gddgddgdddgd          } | j        dk    sJ | j        dk    sJ | j        dk    sJ | j        dk    sJ | j        ddik    sJ | j        dgk    sJ | j        d	gk    sJ | j        g d
gk    sJ | j	        ddgk    sJ | j
        ddgk    sJ | j        dddgdk    sJ d S )Nzhello-worldz$docker.io/library/hello-world:latestz/usr/bin/bashi  i  rx   z/fooz--foozFOO=0815)z	type=bindzsource=lib/moduleszdestination=/lib/moduleszro=true  i   barzfoo
bar)zfoo.confzbar.conf)rS   image
entrypointuidgidvolume_mountsargsenvsbind_mountsportsdirsfiles	container)r
   rT   r   r   r   r   r   r   r   r   r   r   r   s    r$   test_custom_container_specr     s   -%K*9#'#'.3V_%,I%/L$% $% $%,! '+D\%*EN/905u~&! &!%" " "D, ++++?o----8t8t%00009	!!!!9$$$$	
 	
 	
      :$%%%%9&&&&:EN       r&   c                  h    t          ddd           } |                                 }dD ]}||vsJ 	d S )Nrx   )rS   r   r   )r   r   r   r   r   )r
   config_json)r^   r   keys      r$   &test_custom_container_spec_config_jsonr   F  sT    %u4HHHD""$$KB & &+%%%%%& &r&   c                      d} t          j        |           }t          j        |          }|j        dk    sJ |j        dk    sJ |j        dk    sJ |j        dk    sJ |j        dk    sJ d S )Nzservice_type: ingress
service_id: rgw.foo
placement:
  hosts:
    - host1
    - host2
    - host3
spec:
  virtual_ip: 192.168.20.1/24
  backend_service: rgw.foo
  frontend_port: 8080
  monitor_port: 8081
ingresszrgw.fooz192.168.20.1/24r   i  )	r   r   r   r   rT   rS   
virtual_ipfrontend_portmonitor_port)yaml_str	yaml_filer^   s      r$   test_ingress_specr   M  s    H x((I ++D	))))?i''''?/////%%%%$$$$$$r&   zy, error_match)zI
service_type: rgw
service_id: foo
placement:
  count_per_host: "twelve"
z&count-per-host must be a numeric value)zD
service_type: rgw
service_id: foo
placement:
  count_per_host: "2"
'count-per-host must be an integer value)zE
service_type: rgw
service_id: foo
placement:
  count_per_host: 7.36
r   )zA
service_type: rgw
service_id: foo
placement:
  count: "fifteen"
z!num/count must be a numeric value)z;
service_type: rgw
service_id: foo
placement:
  count: "4"
"num/count must be an integer value)z<
service_type: rgw
service_id: foo
placement:
  count: 7.36
r   )z9
service_type: rgw
service_id: foo
placement:
  count: 0
znum/count must be >= 1)zB
service_type: rgw
service_id: foo
placement:
  count_per_host: 0
zcount-per-host must be >= 1)ag  
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_password: mypassword
    snmp_v3_auth_username: myuser
    snmp_v3_priv_password: mysecret
  port: 9464
  engine_id: 8000c53f0000000000
  privacy_protocol: WEIRD
  snmp_destination: 192.168.122.1:162
  auth_protocol: BIZARRE
  snmp_version: V3
2auth_protocol unsupported. Must be one of MD5, SHA)z
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_community: public
  snmp_destination: 192.168.1.42:162
  snmp_version: V4
z0snmp_version unsupported. Must be one of V2c, V3z
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_community: public
  port: 9464
  snmp_destination: 192.168.1.42:162
z#Missing SNMP version (snmp_version))a  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
  port: 9464
  auth_protocol: wah
  snmp_destination: 192.168.1.42:162
  snmp_version: V3
r   )aG  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: weewah
  snmp_destination: 192.168.1.42:162
  snmp_version: V3
z5privacy_protocol unsupported. Must be one of DES, AES)aD  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: AES
  snmp_destination: 192.168.1.42:162
  snmp_version: V3
z3Must provide an engine_id for SNMP V3 notificationsz
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_community: public
  port: 9464
  snmp_destination: 192.168.1.42
  snmp_version: V2c
z`SNMP destination (snmp_destination) type (IPv4) is invalid. Must be either: IPv4:Port, Name:Port)aW  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: AES
  engine_id: bogus
  snmp_destination: 192.168.1.42:162
  snmp_version: V3
]engine_id must be a string containing 10-64 hex characters. Its length must be divisible by 2a  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
  port: 9464
  auth_protocol: SHA
  engine_id: 8000C53F0000000000
  snmp_version: V3
z4SNMP destination (snmp_destination) must be providedaj  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: AES
  engine_id: 8000C53F0000000000
  snmp_destination: my.imaginary.snmp-host
  snmp_version: V3
zASNMP destination (snmp_destination) is invalid: DNS lookup failedad  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: AES
  engine_id: 8000C53F0000000000
  snmp_destination: 10.79.32.10:fred
  snmp_version: V3
zDSNMP destination (snmp_destination) is invalid: Port must be numeric)aX  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: AES
  engine_id: 8000C53
  snmp_destination: 10.79.32.10:162
  snmp_version: V3
r   )a\  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: AES
  engine_id: 8000C53DOH!
  snmp_destination: 10.79.32.10:162
  snmp_version: V3
r   )a  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: AES
  engine_id: 8000C53FCA7344403DC611EC9B985254002537A6C53FCA7344403DC6112537A60
  snmp_destination: 10.79.32.10:162
  snmp_version: V3
r   )a^  
---
service_type: snmp-gateway
service_name: snmp-gateway
placement:
  count: 1
spec:
  credentials:
    snmp_v3_auth_username: myuser
    snmp_v3_auth_password: mypassword
    snmp_v3_priv_password: mysecret
  port: 9464
  auth_protocol: SHA
  privacy_protocol: AES
  engine_id: 8000C53F00000
  snmp_destination: 10.79.32.10:162
  snmp_version: V3
r   c                     t          j        |           }t          j        t                    5 }t          j        |          }d d d            n# 1 swxY w Y   |                    |          sJ d S r.   )r   r   r/   r0   r   r   r   rz   )r   error_matchr   errspecObjs        r$   "test_service_spec_validation_errorr   d  s    N	 >!D	*	+	+ .s'--. . . . . . . . . . . . . . .99[!!!!!!!s   AAA)*jsonrer   r/   ceph.deployment.service_specr   r   r   r   r   r   r	   r
   ceph.deployment.drive_groupr   ceph.deployment.hostspecr   markparametrizer%   r,   r2   r6   rQ   rh   rq   r~   r   splitr   r   r   r   boolr   r   r   r   r   r   escaper   r   r&   r$   <module>r      s    				                      7 6 6 6 6 6 8 8 8 8 8 8 ?
 
 
 = = =$    0i i1 0i
    ". .# ". .% , , ,
  M"""999	
 Ms+++999	
 M===999	
 Mv...,,,	
 M@@@,,,	
+ : ; :  4 	V$	V$	V$	&	'	"F+	'
 
	* 	*
 
	* 6  	 		 		 			% 	% 	% uj 
E'NNmv vnC Cov vnC1 1 1; ; ;   + &1[6;&' &' &' &1[6;&' &' &' &* &1[6;&' &' &' &1[6;49&' &' &' &*	 &1[6;&' &' &' &1[6;&' &' &' &* &1[6;&' &' &' &4^%5%5%) &1[6;&' &' &' &1[6;49&' &' &' &+	 &1[6;49&' &' &' &-W%>%>%>%)_78 8r"[ "("" " "s8 8r"   
 
) )
 
)
   
 
 
 

+ + +\& & &% % %. )011+,, %;"9
 RY455	7	;	>"	<"
 RYqrr	t	f$
 RYEFF	H
" RYRSS#	U$
" RYUVV#	X$	f$	f$	f$	fge, e eL	" "M	e eL	" " "r&   