mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-10-31 05:45:26 +01:00 
			
		
		
		
	Add file to check whether ~/etc/client-simulation.txt is parsable
This commit is contained in:
		
							
								
								
									
										28
									
								
								t/02_clientsim_txt_parsable.t
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								t/02_clientsim_txt_parsable.t
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,28 @@ | |||||||
|  | #!/usr/bin/env perl | ||||||
|  |  | ||||||
|  | # Just a functional test, whether there are any problems on the client side | ||||||
|  | # Probably we could also inspect the JSON for any problems for | ||||||
|  | #    "id"           : "scanProblem" | ||||||
|  | #    "finding"      : "Scan interrupted" | ||||||
|  |  | ||||||
|  | use strict; | ||||||
|  | use Test::More; | ||||||
|  |  | ||||||
|  | my $tests = 0; | ||||||
|  | my $check2run ="--client-simulation -q --ip=one --color 0"; | ||||||
|  | my $fileout=""; | ||||||
|  | # Blacklists we use to trigger an error: | ||||||
|  | my $error_regexp1='(syntax|parse) (e|E)rror'; | ||||||
|  | my $error_regexp2='client-simulation.txt:'; | ||||||
|  |  | ||||||
|  | printf "\n%s\n", "Testing whether \"~/etc/client-simulation.txt\" isn't broken ..."; | ||||||
|  | $fileout = `bash ./etc/client-simulation.txt 2>&1`; | ||||||
|  | unlike($fileout, qr/$error_regexp1/, ""); | ||||||
|  | $tests++; | ||||||
|  |  | ||||||
|  | unlike($fileout, qr/$error_regexp2/, ""); | ||||||
|  | $tests++; | ||||||
|  |  | ||||||
|  | done_testing($tests); | ||||||
|  |  | ||||||
|  |  | ||||||
		Reference in New Issue
	
	Block a user
	 Dirk Wetter
					Dirk Wetter