| 
									
										
										
										
											2011-10-11 04:21:17 +08:00
										 |  |  | start_server {tags {"auth"}} { | 
					
						
							|  |  |  |     test {AUTH fails if there is no password configured server side} { | 
					
						
							|  |  |  |         catch {r auth foo} err | 
					
						
							|  |  |  |         set _ $err | 
					
						
							| 
									
										
										
										
											2019-01-18 01:30:23 +08:00
										 |  |  |     } {ERR*any password*} | 
					
						
							| 
									
										
										
										
											2011-10-11 04:21:17 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-06-03 05:14:55 +08:00
										 |  |  | start_server {tags {"auth"} overrides {requirepass foobar}} { | 
					
						
							| 
									
										
										
										
											2010-05-14 23:31:11 +08:00
										 |  |  |     test {AUTH fails when a wrong password is given} { | 
					
						
							|  |  |  |         catch {r auth wrong!} err | 
					
						
							| 
									
										
										
										
											2011-10-11 04:21:17 +08:00
										 |  |  |         set _ $err | 
					
						
							| 
									
										
										
										
											2019-01-18 01:30:23 +08:00
										 |  |  |     } {WRONGPASS*} | 
					
						
							| 
									
										
										
										
											2014-08-01 02:39:49 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-14 23:31:11 +08:00
										 |  |  |     test {Arbitrary command gives an error when AUTH is required} { | 
					
						
							|  |  |  |         catch {r set foo bar} err | 
					
						
							| 
									
										
										
										
											2011-10-11 04:21:17 +08:00
										 |  |  |         set _ $err | 
					
						
							| 
									
										
										
										
											2013-02-12 23:25:41 +08:00
										 |  |  |     } {NOAUTH*} | 
					
						
							| 
									
										
										
										
											2010-05-14 23:31:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     test {AUTH succeeds when the right password is given} { | 
					
						
							|  |  |  |         r auth foobar | 
					
						
							|  |  |  |     } {OK} | 
					
						
							| 
									
										
										
										
											2011-10-11 04:21:17 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     test {Once AUTH succeeded we can actually send commands to the server} { | 
					
						
							|  |  |  |         r set foo 100 | 
					
						
							|  |  |  |         r incr foo | 
					
						
							|  |  |  |     } {101} | 
					
						
							| 
									
										
										
										
											2010-05-14 23:31:11 +08:00
										 |  |  | } |