From 4508ffac3ad3afe58d4c067db865edffa62fe43d Mon Sep 17 00:00:00 2001 From: Mrinal Purohit Date: Wed, 27 Oct 2021 09:49:18 +0530 Subject: [PATCH 1/2] google-cloud-sdk: 361.0.0 -> 362.0.0 --- pkgs/tools/admin/google-cloud-sdk/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix index 1820781cd650..4949d68de7c7 100644 --- a/pkgs/tools/admin/google-cloud-sdk/default.nix +++ b/pkgs/tools/admin/google-cloud-sdk/default.nix @@ -21,33 +21,33 @@ let sources = name: system: { x86_64-darwin = { url = "${baseUrl}/${name}-darwin-x86_64.tar.gz"; - sha256 = "1gwi15rkgxmqcr1vi5bd123833zhln725bhs5k1ip6fvhdrx31mf"; + sha256 = "19s3nryngzv7zs7piwx92hii5p2y97fs7wngqrd9v8cxvgavp1dc"; }; aarch64-darwin = { url = "${baseUrl}/${name}-darwin-arm.tar.gz"; - sha256 = "0pw2cwdx18cw77lqsq1bsd8d79mjxn7lwd27hm9j8d45r0fzj0ci"; + sha256 = "1iphpkxrrp0gdan7ikbjbhykdpazcs1fnlcwkfyv2m9baggkd53z"; }; x86_64-linux = { url = "${baseUrl}/${name}-linux-x86_64.tar.gz"; - sha256 = "01v3v4408p1wwqlqqawbc9g8j6lipwnm1sr6wckq9q0a5zpsissg"; + sha256 = "1z1ymvij9vi8jc05b004jhd08dqbk133wd03fdxnagd6nfr0bjqm"; }; i686-linux = { url = "${baseUrl}/${name}-linux-x86.tar.gz"; - sha256 = "125akqbbz1ahq0hhgbjrv1cfnv41h1pksnclz6mbdn3z2297r6dp"; + sha256 = "17i5pkwjmi38klgr12xqgza7iwkx459cbavlq0x33zaq2a4zanlc"; }; aarch64-linux = { url = "${baseUrl}/${name}-linux-arm.tar.gz"; - sha256 = "13p0vjs330zljkyfb412n6l33m5sn6kakg1wch9nhgikrqig5avl"; + sha256 = "17zjnab4ai5w6p3cbxys9zsg4bdlp0lh6pvmkvdz9hszxxch4yms"; }; }.${system} or (throw "Unsupported system: ${system}"); in stdenv.mkDerivation rec { pname = "google-cloud-sdk"; - version = "361.0.0"; + version = "362.0.0"; src = fetchurl (sources "${pname}-${version}" stdenv.hostPlatform.system); From 6bc1c211491ad8e1c970c3118b8ea65375757bea Mon Sep 17 00:00:00 2001 From: Mrinal Purohit Date: Wed, 27 Oct 2021 10:40:06 +0530 Subject: [PATCH 2/2] nixos/tests: add google-cloud-sdk --- nixos/tests/all-tests.nix | 1 + nixos/tests/google-cloud-sdk.nix | 13 +++++++++++++ pkgs/tools/admin/google-cloud-sdk/default.nix | 6 +++++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/google-cloud-sdk.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 9e5dbf1052bb..63c307c09833 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -157,6 +157,7 @@ in gobgpd = handleTest ./gobgpd.nix {}; gocd-agent = handleTest ./gocd-agent.nix {}; gocd-server = handleTest ./gocd-server.nix {}; + google-cloud-sdk = handleTest ./google-cloud-sdk.nix {}; google-oslogin = handleTest ./google-oslogin {}; gotify-server = handleTest ./gotify-server.nix {}; grafana = handleTest ./grafana.nix {}; diff --git a/nixos/tests/google-cloud-sdk.nix b/nixos/tests/google-cloud-sdk.nix new file mode 100644 index 000000000000..3150b2d53c2c --- /dev/null +++ b/nixos/tests/google-cloud-sdk.nix @@ -0,0 +1,13 @@ +import ./make-test-python.nix ({ pkgs, ... }: { + name = "google-cloud-sdk"; + meta = with pkgs.lib.maintainers; { maintainers = [ iammrinal0 ]; }; + + machine = { pkgs, ... }: { + environment.systemPackages = [ pkgs.google-cloud-sdk ]; + }; + + testScript = '' + import json + assert "${pkgs.google-cloud-sdk.version}" in json.loads(machine.succeed("gcloud version --format json"))["Google Cloud SDK"] + ''; +}) diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix index 4949d68de7c7..af33f1b91191 100644 --- a/pkgs/tools/admin/google-cloud-sdk/default.nix +++ b/pkgs/tools/admin/google-cloud-sdk/default.nix @@ -7,7 +7,7 @@ # 3) used by `google-cloud-sdk` only on GCE guests # -{ stdenv, lib, fetchurl, makeWrapper, python, openssl, jq, with-gce ? false }: +{ stdenv, lib, fetchurl, makeWrapper, nixosTests, python, openssl, jq, with-gce ? false }: let pythonEnv = python.withPackages (p: with p; [ @@ -117,6 +117,10 @@ in stdenv.mkDerivation rec { runHook postInstall ''; + passthru = { + tests = { inherit (nixosTests) google-cloud-sdk; }; + }; + meta = with lib; { description = "Tools for the google cloud platform"; longDescription = "The Google Cloud SDK. This package has the programs: gcloud, gsutil, and bq";