Config schema test for plugin
Part of [#141481501] Moved from rabbitmq-server
This commit is contained in:
		
							parent
							
								
									96b51d2bc7
								
							
						
					
					
						commit
						897e194dc8
					
				|  | @ -0,0 +1,64 @@ | ||||||
|  | %% The contents of this file are subject to the Mozilla Public License | ||||||
|  | %% Version 1.1 (the "License"); you may not use this file except in | ||||||
|  | %% compliance with the License. You may obtain a copy of the License at | ||||||
|  | %% http://www.mozilla.org/MPL/ | ||||||
|  | %% | ||||||
|  | %% Software distributed under the License is distributed on an "AS IS" | ||||||
|  | %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | ||||||
|  | %% License for the specific language governing rights and limitations | ||||||
|  | %% under the License. | ||||||
|  | %% | ||||||
|  | %% The Original Code is RabbitMQ. | ||||||
|  | %% | ||||||
|  | %% The Initial Developer of the Original Code is GoPivotal, Inc. | ||||||
|  | %% Copyright (c) 2016 Pivotal Software, Inc.  All rights reserved. | ||||||
|  | %% | ||||||
|  | 
 | ||||||
|  | -module(config_schema_SUITE). | ||||||
|  | 
 | ||||||
|  | -compile(export_all). | ||||||
|  | 
 | ||||||
|  | all() -> | ||||||
|  |     [ | ||||||
|  |         run_snippets | ||||||
|  |     ]. | ||||||
|  | 
 | ||||||
|  | %% ------------------------------------------------------------------- | ||||||
|  | %% Testsuite setup/teardown. | ||||||
|  | %% ------------------------------------------------------------------- | ||||||
|  | 
 | ||||||
|  | init_per_suite(Config) -> | ||||||
|  |     rabbit_ct_helpers:log_environment(), | ||||||
|  |     Config1 = rabbit_ct_helpers:run_setup_steps(Config), | ||||||
|  |     rabbit_ct_config_schema:init_schemas(rabbitmq_mqtt, Config1). | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | end_per_suite(Config) -> | ||||||
|  |     rabbit_ct_helpers:run_teardown_steps(Config). | ||||||
|  | 
 | ||||||
|  | init_per_testcase(Testcase, Config) -> | ||||||
|  |     rabbit_ct_helpers:testcase_started(Config, Testcase), | ||||||
|  |     Config1 = rabbit_ct_helpers:set_config(Config, [ | ||||||
|  |         {rmq_nodename_suffix, Testcase} | ||||||
|  |       ]), | ||||||
|  |     rabbit_ct_helpers:run_steps(Config1, | ||||||
|  |       rabbit_ct_broker_helpers:setup_steps() ++ | ||||||
|  |       rabbit_ct_client_helpers:setup_steps()). | ||||||
|  | 
 | ||||||
|  | end_per_testcase(Testcase, Config) -> | ||||||
|  |     Config1 = rabbit_ct_helpers:run_steps(Config, | ||||||
|  |       rabbit_ct_client_helpers:teardown_steps() ++ | ||||||
|  |       rabbit_ct_broker_helpers:teardown_steps()), | ||||||
|  |     rabbit_ct_helpers:testcase_finished(Config1, Testcase). | ||||||
|  | 
 | ||||||
|  | %% ------------------------------------------------------------------- | ||||||
|  | %% Testcases. | ||||||
|  | %% ------------------------------------------------------------------- | ||||||
|  | 
 | ||||||
|  | run_snippets(Config) -> | ||||||
|  |     ok = rabbit_ct_broker_helpers:rpc(Config, 0, | ||||||
|  |       ?MODULE, run_snippets1, [Config]). | ||||||
|  | 
 | ||||||
|  | run_snippets1(Config) -> | ||||||
|  |     rabbit_ct_config_schema:run_snippets(Config). | ||||||
|  | 
 | ||||||
|  | @ -0,0 +1 @@ | ||||||
|  | I'm not a certificate | ||||||
|  | @ -0,0 +1 @@ | ||||||
|  | I'm not a certificate | ||||||
|  | @ -0,0 +1 @@ | ||||||
|  | I'm not a certificate | ||||||
|  | @ -0,0 +1,105 @@ | ||||||
|  | [{defaults, | ||||||
|  |   "listeners.tcp.default = 5672 | ||||||
|  |    mqtt.default_user     = guest | ||||||
|  |    mqtt.default_pass     = guest | ||||||
|  |    mqtt.allow_anonymous  = true | ||||||
|  |    mqtt.vhost            = / | ||||||
|  |    mqtt.exchange         = amq.topic | ||||||
|  |    mqtt.subscription_ttl = 1800000 | ||||||
|  |    mqtt.prefetch         = 10 | ||||||
|  |    mqtt.listeners.ssl    = none | ||||||
|  | ## Default MQTT with TLS port is 8883 | ||||||
|  | #  mqtt.listeners.ssl.default = 8883 | ||||||
|  |    mqtt.listeners.tcp.default = 1883 | ||||||
|  |    mqtt.tcp_listen_options.backlog = 128 | ||||||
|  |    mqtt.tcp_listen_options.nodelay = true | ||||||
|  |    mqtt.proxy_protocol = false", | ||||||
|  |   [{rabbit,[{tcp_listeners,[5672]}]}, | ||||||
|  |    {rabbitmq_mqtt, | ||||||
|  |        [{default_user,<<"guest">>}, | ||||||
|  |         {default_pass,<<"guest">>}, | ||||||
|  |         {allow_anonymous,true}, | ||||||
|  |         {vhost,<<"/">>}, | ||||||
|  |         {exchange,<<"amq.topic">>}, | ||||||
|  |         {subscription_ttl,1800000}, | ||||||
|  |         {prefetch,10}, | ||||||
|  |         {ssl_listeners,[]}, | ||||||
|  |         {tcp_listeners,[1883]}, | ||||||
|  |         {tcp_listen_options,[{backlog,128},{nodelay,true}]}, | ||||||
|  |         {proxy_protocol,false}]}], | ||||||
|  |   [rabbitmq_mqtt]}, | ||||||
|  |  {ssl, | ||||||
|  |   "ssl_options.cacertfile = test/config_schema_SUITE_data/certs/cacert.pem | ||||||
|  |    ssl_options.certfile   = test/config_schema_SUITE_data/certs/cert.pem | ||||||
|  |    ssl_options.keyfile    = test/config_schema_SUITE_data/certs/key.pem | ||||||
|  |    ssl_options.verify     = verify_peer | ||||||
|  |    ssl_options.fail_if_no_peer_cert  = true | ||||||
|  | 
 | ||||||
|  |    mqtt.listeners.ssl.default = 8883 | ||||||
|  |    mqtt.listeners.tcp.default = 1883", | ||||||
|  |   [{rabbit, | ||||||
|  |        [{ssl_options, | ||||||
|  |             [{cacertfile,"test/config_schema_SUITE_data/certs/cacert.pem"}, | ||||||
|  |              {certfile,"test/config_schema_SUITE_data/certs/cert.pem"}, | ||||||
|  |              {keyfile,"test/config_schema_SUITE_data/certs/key.pem"}, | ||||||
|  |              {verify,verify_peer}, | ||||||
|  |              {fail_if_no_peer_cert,true}]}]}, | ||||||
|  |    {rabbitmq_mqtt,[{ssl_listeners,[8883]},{tcp_listeners,[1883]}]}], | ||||||
|  |   [rabbitmq_mqtt]}, | ||||||
|  |  {ssl_cert_login, | ||||||
|  |   "mqtt.ssl_cert_login = true", | ||||||
|  |   [{rabbitmq_mqtt,[{ssl_cert_login,true}]}], | ||||||
|  |   [rabbitmq_mqtt]}, | ||||||
|  |  {ssl_cert_login_from, | ||||||
|  |   "ssl_cert_login_from = common_name", | ||||||
|  |   [{rabbit,[{ssl_cert_login_from,common_name}]}], | ||||||
|  |   [rabbitmq_mqtt]}, | ||||||
|  |  {proxy_protocol, | ||||||
|  |   "listeners.tcp.default = 5672 | ||||||
|  |    mqtt.default_user     = guest | ||||||
|  |    mqtt.default_pass     = guest | ||||||
|  |    mqtt.allow_anonymous  = true | ||||||
|  |    mqtt.vhost            = / | ||||||
|  |    mqtt.exchange         = amq.topic | ||||||
|  |    mqtt.subscription_ttl = undefined | ||||||
|  |    mqtt.prefetch         = 10 | ||||||
|  |    mqtt.proxy_protocol = true", | ||||||
|  |   [{rabbit,[{tcp_listeners,[5672]}]}, | ||||||
|  |    {rabbitmq_mqtt, | ||||||
|  |        [{default_user,<<"guest">>}, | ||||||
|  |         {default_pass,<<"guest">>}, | ||||||
|  |         {allow_anonymous,true}, | ||||||
|  |         {vhost,<<"/">>}, | ||||||
|  |         {exchange,<<"amq.topic">>}, | ||||||
|  |         {subscription_ttl,undefined}, | ||||||
|  |         {prefetch,10}, | ||||||
|  |         {proxy_protocol,true}]}], | ||||||
|  |   [rabbitmq_mqtt]}, | ||||||
|  |  {prefetch_retained_msg_store, | ||||||
|  |   "mqtt.default_user     = guest | ||||||
|  |    mqtt.default_pass     = guest | ||||||
|  |    mqtt.allow_anonymous  = true | ||||||
|  |    mqtt.vhost            = / | ||||||
|  |    mqtt.exchange         = amq.topic | ||||||
|  |    mqtt.subscription_ttl = 1800000 | ||||||
|  |    mqtt.prefetch         = 10 | ||||||
|  | ## use DETS (disk-based) store for retained messages | ||||||
|  |    mqtt.retained_message_store = rabbit_mqtt_retained_msg_store_dets | ||||||
|  | ## only used by DETS store | ||||||
|  |    mqtt.retained_message_store_dets_sync_interval = 2000 | ||||||
|  | 
 | ||||||
|  |    mqtt.listeners.ssl = none | ||||||
|  |    mqtt.listeners.tcp.default = 1883", | ||||||
|  |   [{rabbitmq_mqtt, | ||||||
|  |        [{default_user,<<"guest">>}, | ||||||
|  |         {default_pass,<<"guest">>}, | ||||||
|  |         {allow_anonymous,true}, | ||||||
|  |         {vhost,<<"/">>}, | ||||||
|  |         {exchange,<<"amq.topic">>}, | ||||||
|  |         {subscription_ttl,1800000}, | ||||||
|  |         {prefetch,10}, | ||||||
|  |         {retained_message_store,rabbit_mqtt_retained_msg_store_dets}, | ||||||
|  |         {retained_message_store_dets_sync_interval,2000}, | ||||||
|  |         {ssl_listeners,[]}, | ||||||
|  |         {tcp_listeners,[1883]}]}], | ||||||
|  |   [rabbitmq_mqtt]}]. | ||||||
		Loading…
	
		Reference in New Issue