mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-29 21:13:01 +00:00 
			
		
		
		
	tests for JOIN and various replies
Brandon Beresini sent me a patch yesterday adding tests for JOIN under various circumstances, which I believe he worked on with Bryan Caldwell and Ali Shemiran. I made a few modifications; the result is below.
This commit is contained in:
		 Dana Dahlstrom
					Dana Dahlstrom
				
			
				
					committed by
					
						 Florian Westphal
						Florian Westphal
					
				
			
			
				
	
			
			
			 Florian Westphal
						Florian Westphal
					
				
			
						parent
						
							3d8eda9c86
						
					
				
				
					commit
					c63d8fd051
				
			| @@ -21,7 +21,7 @@ EXTRA_DIST = \ | ||||
| 	start-server.sh stop-server.sh tests.sh stress-server.sh \ | ||||
| 	test-loop.sh wait-tests.sh \ | ||||
| 	channel-test.e connect-test.e check-idle.e misc-test.e mode-test.e \ | ||||
| 	kick-test.e \ | ||||
| 	join-test.e kick-test.e \ | ||||
| 	opless-channel-test.e \ | ||||
| 	who-test.e stress-A.e stress-B.e \ | ||||
| 	ngircd-test.conf | ||||
| @@ -49,6 +49,10 @@ channel-test: tests.sh | ||||
| 	rm -f channel-test | ||||
| 	ln -s $(srcdir)/tests.sh channel-test | ||||
|  | ||||
| join-test: tests.sh | ||||
| 	rm -f join-test | ||||
| 	ln -s $(srcdir)/tests.sh join-test | ||||
|  | ||||
| kick-test: tests.sh | ||||
| 	rm -f kick-test | ||||
| 	ln -s $(srcdir)/tests.sh kick-test | ||||
| @@ -72,11 +76,12 @@ mode-test: tests.sh | ||||
| TESTS = start-server.sh \ | ||||
| 	connect-test \ | ||||
| 	channel-test \ | ||||
| 	join-test \ | ||||
| 	kick-test \ | ||||
| 	misc-test \ | ||||
| 	mode-test \ | ||||
| 	who-test \ | ||||
| 	opless-channel-test \ | ||||
| 	who-test \ | ||||
| 	stress-server.sh \ | ||||
| 	stop-server.sh | ||||
|  | ||||
|   | ||||
							
								
								
									
										68
									
								
								src/testsuite/join-test.e
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								src/testsuite/join-test.e
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,68 @@ | ||||
| spawn telnet localhost 6789 | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "Connected" | ||||
| } | ||||
|  | ||||
| send "nick nick\r" | ||||
| send "user user . . :User\r" | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "376" | ||||
| } | ||||
|  | ||||
| send "JOIN\r" | ||||
| expect { | ||||
|        timeout { exit 1} | ||||
|        "461" | ||||
| } | ||||
|  | ||||
| send "JOIN #InviteChannel\r" | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "473" | ||||
| } | ||||
|  | ||||
| send "JOIN #FullKeyed\r" | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "475" | ||||
| } | ||||
|  | ||||
| send "JOIN #FullKeyed WrongKey\r" | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "475" | ||||
| } | ||||
|  | ||||
| send "JOIN #FullKeyed Secret\r" | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "471" | ||||
| } | ||||
|  | ||||
| send "JOIN #TopicChannel\r" | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "@* JOIN :#TopicChannel" | ||||
| } | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "332" | ||||
| } | ||||
|  | ||||
| send "JOIN 0\r" | ||||
| send "JOIN #1,#2,#3,#4\r" | ||||
| send "JOIN #5\r" | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "405" | ||||
| } | ||||
|  | ||||
| send "quit\r" | ||||
| expect { | ||||
|        timeout { exit 1 } | ||||
|        "Connection closed" | ||||
| } | ||||
|  | ||||
| # -eof- | ||||
| @@ -8,9 +8,25 @@ | ||||
| 	AdminEMail = admin@irc.server | ||||
| 	MaxConnectionsIP = 0 | ||||
| 	OperCanUseMode = yes | ||||
| 	MaxJoins = 4 | ||||
|  | ||||
| [Operator] | ||||
| 	Name = TestOp | ||||
| 	Password = 123 | ||||
|  | ||||
| [CHANNEL] | ||||
| 	Name = #InviteChannel | ||||
| 	Modes = i | ||||
|  | ||||
| [CHANNEL] | ||||
| 	Name = #FullKeyed | ||||
| 	Modes = lk | ||||
| 	MaxUsers = 0 | ||||
| 	Key = Secret | ||||
|  | ||||
| [CHANNEL] | ||||
| 	Name = #TopicChannel | ||||
| 	Modes = t | ||||
| 	Topic = the topic | ||||
|  | ||||
| # -eof- | ||||
|   | ||||
		Reference in New Issue
	
	Block a user