mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-10-31 05:45:26 +01:00 
			
		
		
		
	Merge pull request #1239 from drwetter/add_travis_json
clarify failed test, add new test
This commit is contained in:
		| @@ -21,6 +21,7 @@ my ( | |||||||
| $tests = 0; | $tests = 0; | ||||||
|  |  | ||||||
| my $hostn = "cloudflare.com"; | my $hostn = "cloudflare.com"; | ||||||
|  | my $hostm = "smtp-relay.gmail.com:587"; | ||||||
| unlink 'tmp.json'; | unlink 'tmp.json'; | ||||||
|  |  | ||||||
| #1 | #1 | ||||||
| @@ -36,9 +37,11 @@ is(@errors,0,"no errors"); | |||||||
| $tests++; | $tests++; | ||||||
|  |  | ||||||
| #3 | #3 | ||||||
| pass("Running testssl.sh --mx against $hostn with plain JSON"); | # This testss.sh run deliberately does NOT work as travis-ci.org blocks port 25 egress. The idea | ||||||
|  | # is to have a unit test for a failed connection.  | ||||||
|  | pass("Running testssl.sh --mx against $hostn with plain JSON -- run will fail"); | ||||||
| $tests++; | $tests++; | ||||||
| $out = `./testssl.sh --ssl-native --ip=one --mx -q --jsonfile tmp.json --color 0 $hostn`; | $out = `./testssl.sh --ssl-native --openssl-timeout=10 --ip=one --mx -q --jsonfile tmp.json --color 0 $hostn`; | ||||||
| $json = json('tmp.json'); | $json = json('tmp.json'); | ||||||
| unlink 'tmp.json'; | unlink 'tmp.json'; | ||||||
|  |  | ||||||
| @@ -47,6 +50,19 @@ my @errors = $jv->validate(@$json); | |||||||
| is(@errors,0,"no errors"); | is(@errors,0,"no errors"); | ||||||
| $tests++; | $tests++; | ||||||
|  |  | ||||||
|  | #5 | ||||||
|  | pass("Running testssl.sh against $hostm with plain JSON output"); | ||||||
|  | $out = `./testssl.sh  --jsonfile tmp.json --color 0  -t smtp  $hostm`; | ||||||
|  | $tests++; | ||||||
|  | $json = json('tmp.json'); | ||||||
|  | unlink 'tmp.json'; | ||||||
|  |  | ||||||
|  | #6 | ||||||
|  | my @errors = $jv->validate(@$json); | ||||||
|  | is(@errors,0,"no errors"); | ||||||
|  | $tests++; | ||||||
|  |  | ||||||
|  |  | ||||||
| done_testing($tests); | done_testing($tests); | ||||||
|  |  | ||||||
| sub json($) { | sub json($) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Dirk Wetter
					Dirk Wetter