| ##### |
| # Test of passing a non-file to -mode=binary |
| $ govulncheck -mode=binary notafile --> FAIL 2 |
| "notafile" is not a file |
| |
| ##### |
| # Test of passing a non-binary and non-blob file to -mode=binary |
| $ govulncheck -mode=binary ${moddir}/vuln/go.mod --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing a blob with invalid header id |
| $ govulncheck -mode=binary ${testdir}/failures/invalid_header_name.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing a blob with invalid header version |
| $ govulncheck -mode=binary ${testdir}/failures/invalid_header_version.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing a blob with no header |
| $ govulncheck -mode=binary ${testdir}/failures/no_header.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing a blob with invalid header, i.e., no header |
| $ govulncheck -mode=binary ${testdir}/failures/no_header.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing a blob with no body |
| $ govulncheck -mode=binary ${testdir}/failures/no_body.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing an empty blob/file |
| $ govulncheck -mode=binary ${testdir}/failures/empty.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing an empty blob message |
| $ govulncheck -mode=binary ${testdir}/failures/empty_message.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing blob message with multiple headers |
| $ govulncheck -mode=binary ${testdir}/failures/multi_header.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of passing blob message with something after the body |
| $ govulncheck -mode=binary ${testdir}/failures/multi_header.blob --> FAIL 1 |
| govulncheck: unrecognized binary format |
| |
| ##### |
| # Test of trying to analyze multiple binaries |
| $ govulncheck -mode=binary ${common_vuln_binary} ${common_vuln_binary} --> FAIL 2 |
| only 1 binary can be analyzed at a time |
| |
| ##### |
| # Test of trying to run -mode=binary with -tags flag |
| $ govulncheck -tags=foo -mode=binary ${common_vuln_binary} --> FAIL 2 |
| the -tags flag is not supported in binary mode |
| |
| ##### |
| # Test of trying to run -mode=binary with the -test flag |
| $ govulncheck -test -mode=binary ${common_vuln_binary} --> FAIL 2 |
| the -test flag is not supported in binary mode |