adding negative test for user with no permissions
This commit is contained in:
		
							parent
							
								
									0e54440a1b
								
							
						
					
					
						commit
						5552d24244
					
				|  | @ -62,6 +62,7 @@ RABBITMQ_NODENAME=rabbit | |||
| BROKER_START_ARGS=-pa $(realpath $(LOAD_PATH)) | ||||
| MAKE_BROKER=$(MAKE) RABBITMQ_SERVER_START_ARGS='$(BROKER_START_ARGS)' -C $(BROKER_DIR) | ||||
| ERL_CALL_BROKER=erl_call -sname $(RABBITMQ_NODENAME) -e | ||||
| RABBITMQCTL=$(BROKER_DIR)/scripts/rabbitmqctl | ||||
| 
 | ||||
| PLT=$(HOME)/.dialyzer_plt | ||||
| DIALYZER_CALL=dialyzer --plt $(PLT) | ||||
|  | @ -238,9 +239,12 @@ clean_test_error_flag: | |||
| prepare_for_testing: compile compile_tests \ | ||||
|                      start_background_node_in_broker \
 | ||||
|                      clean_test_error_flag | ||||
| 	$(RABBITMQCTL) delete_user test_user_no_perm || echo "No user to delete." | ||||
| 	$(RABBITMQCTL) add_user test_user_no_perm test_user_no_perm | ||||
| 
 | ||||
| .PHONY: cleanup_after_testing | ||||
| cleanup_after_testing: stop_background_node_in_broker | ||||
| 	$(RABBITMQCTL) delete_user no_perm_test_user | ||||
| 	@test -e .test_error || echo "All tests successful." | ||||
| 	@test ! -e .test_error || echo "*** One or more tests FAILED! See SASL log for details. ***" | ||||
| 	@test ! -e .test_error | ||||
|  |  | |||
|  | @ -65,3 +65,8 @@ invalid_password_test() -> | |||
| non_existent_vhost_test() -> | ||||
|     ?assertError(_, amqp_connection:start_network("guest", "guest", "localhost", | ||||
|                                                   <<"bum_vhost">>)). | ||||
| 
 | ||||
| no_perm_user_test() -> | ||||
|     ?assertError(_, amqp_connection:start_network("test_user_no_perm", | ||||
|                                                   "test_user_no_perm", | ||||
|                                                   "localhost")). | ||||
|  |  | |||
|  | @ -83,6 +83,9 @@ invalid_password_test() -> | |||
| non_existent_vhost_test() -> | ||||
|     negative_test_util:non_existent_vhost_test(). | ||||
| 
 | ||||
| no_perm_user_test() -> | ||||
|     negative_test_util:no_perm_user_test(). | ||||
| 
 | ||||
| %%--------------------------------------------------------------------------- | ||||
| %% Common Functions | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue