From b8e3d45a3562a80d38362a2c928e4a336d2378b3 Mon Sep 17 00:00:00 2001 From: thesayyn Date: Tue, 17 Jan 2023 18:34:18 +0300 Subject: [PATCH] add hashes e2e --- e2e/bzlmod_coreutils/BUILD.bazel | 22 ++++++++++++++++++++++ e2e/bzlmod_coreutils/md5.txt | 1 + e2e/bzlmod_coreutils/sha1.txt | 1 + e2e/bzlmod_coreutils/sha256.txt | 1 + e2e/bzlmod_coreutils/test.bin | 1 + 5 files changed, 26 insertions(+) create mode 100644 e2e/bzlmod_coreutils/md5.txt create mode 100644 e2e/bzlmod_coreutils/sha1.txt create mode 100644 e2e/bzlmod_coreutils/sha256.txt create mode 100644 e2e/bzlmod_coreutils/test.bin diff --git a/e2e/bzlmod_coreutils/BUILD.bazel b/e2e/bzlmod_coreutils/BUILD.bazel index a0a6a6980..1e954f05e 100644 --- a/e2e/bzlmod_coreutils/BUILD.bazel +++ b/e2e/bzlmod_coreutils/BUILD.bazel @@ -1,4 +1,5 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") +load("@aspect_bazel_lib//tools:hashes.bzl", "hashes") genrule( name = "ls", @@ -7,12 +8,33 @@ genrule( toolchains = ["@coreutils_toolchains//:resolved_toolchain"], ) +hashes( + name = "hash", + src = "test.bin" +) + +filegroup( + name = "md5", + output_group = "md5", + srcs = [":hash"] +) + +filegroup( + name = "sha1", + output_group = "sha1", + srcs = [":hash"] +) + + # This tests that the "in" file to write_source_files can be a # label to an external repository target when bzlmod is enabled. write_source_files( name = "write_ls", files = { "ls.txt.expected": ":ls.txt", + "sha256.txt": ":hash", + "sha1.txt": ":sha1", + "md5.txt": ":md5" }, ) diff --git a/e2e/bzlmod_coreutils/md5.txt b/e2e/bzlmod_coreutils/md5.txt new file mode 100644 index 000000000..b75ade6e6 --- /dev/null +++ b/e2e/bzlmod_coreutils/md5.txt @@ -0,0 +1 @@ +160e389707f172f2d1333084fec4e650 test.bin \ No newline at end of file diff --git a/e2e/bzlmod_coreutils/sha1.txt b/e2e/bzlmod_coreutils/sha1.txt new file mode 100644 index 000000000..692902101 --- /dev/null +++ b/e2e/bzlmod_coreutils/sha1.txt @@ -0,0 +1 @@ +b3dd96b0db6a12a3ae53899e8fbc04b749c980d6 test.bin \ No newline at end of file diff --git a/e2e/bzlmod_coreutils/sha256.txt b/e2e/bzlmod_coreutils/sha256.txt new file mode 100644 index 000000000..4241fd02d --- /dev/null +++ b/e2e/bzlmod_coreutils/sha256.txt @@ -0,0 +1 @@ +3285d399e870df47749162ab2ebfd0b727e9142925ab5f5ad221c3a42a852b08 test.bin \ No newline at end of file diff --git a/e2e/bzlmod_coreutils/test.bin b/e2e/bzlmod_coreutils/test.bin new file mode 100644 index 000000000..2bfc11b15 --- /dev/null +++ b/e2e/bzlmod_coreutils/test.bin @@ -0,0 +1 @@ +act as if this is binary file \ No newline at end of file