nixos/tests: add google-cloud-sdk

This commit is contained in:
Mrinal Purohit 2021-10-27 10:40:06 +05:30
parent 4508ffac3a
commit 6bc1c21149
3 changed files with 19 additions and 1 deletions

View File

@ -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 {};

View File

@ -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"]
'';
})

View File

@ -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";