aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar Dmitry Lomov <dslomov@google.com>2018-01-15 08:23:44 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-15 08:25:46 -0800
commit2944fdc2eba77e785d6345d1783e59806ee4e5c2 (patch)
tree83ffb5e503bbdaedeea76506d18a57961802b4a6 /src/test/shell
parente042e9e31f8c861d60f932b6eb612b1106886903 (diff)
Regression test for #3656.
Change-Id: Id3d6e6da60aca3c02c7cf3e9e727ecbf177dde66 PiperOrigin-RevId: 181971084
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/external_integration_test.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/test/shell/bazel/external_integration_test.sh b/src/test/shell/bazel/external_integration_test.sh
index 886bc037bf..a899c1183d 100755
--- a/src/test/shell/bazel/external_integration_test.sh
+++ b/src/test/shell/bazel/external_integration_test.sh
@@ -873,6 +873,51 @@ EOF
shutdown_server
}
+function test_sha256_weird() {
+ REPO_PATH=$TEST_TMPDIR/repo
+ mkdir -p "$REPO_PATH"
+ cd "$REPO_PATH"
+ touch WORKSPACE BUILD foo
+ zip -r repo.zip *
+ startup_server $PWD
+ cd -
+
+ cat > WORKSPACE <<EOF
+http_archive(
+ name = "repo",
+ sha256 = "a random string",
+ url = "http://127.0.0.1:$fileserver_port/repo.zip",
+)
+EOF
+ bazel build @repo//... &> $TEST_log && fail "Expected to fail"
+ expect_log "Invalid SHA256 checksum"
+ shutdown_server
+}
+
+function test_sha256_incorrect() {
+ REPO_PATH=$TEST_TMPDIR/repo
+ mkdir -p "$REPO_PATH"
+ cd "$REPO_PATH"
+ touch WORKSPACE BUILD foo
+ zip -r repo.zip *
+ startup_server $PWD
+ cd -
+
+ cat > WORKSPACE <<EOF
+http_archive(
+ name = "repo",
+ sha256 = "61a6f762aaf60652cbf332879b8dcc2cfd81be2129a061da957d039eae77f0b0",
+ url = "http://127.0.0.1:$fileserver_port/repo.zip",
+)
+EOF
+ bazel build @repo//... &> $TEST_log 2>&1 && fail "Expected to fail"
+ expect_log "Error downloading \\[http://127.0.0.1:$fileserver_port/repo.zip\\] to"
+ expect_log "but wanted 61a6f762aaf60652cbf332879b8dcc2cfd81be2129a061da957d039eae77f0b0"
+ shutdown_server
+}
+
+
+
function test_same_name() {
mkdir ext
echo foo> ext/foo