patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob 592917ccc8c070f2fd404f7b65c3a9ee1147f9f0 2241 bytes (raw)
name: release/checks/integration/default.nix 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2023, 2025 Alyssa Ross <hi@alyssa.is>

import ../../../lib/call-package.nix (
{ callSpectrumPackage, src, lib, stdenv, runCommand, writeShellScript
, clang-tools, meson, ninja, e2fsprogs, tar2ext4, libressl, qemu_kvm
}:

let
  live = callSpectrumPackage ../../live {};

  ncVm = callSpectrumPackage ../../../vm/make-vm.nix {} {
    providers.net = [ "sys.netvm" ];
    type = "nix";
    run = writeShellScript "run" ''
      set -x
      while ! echo hello | ${libressl.nc}/bin/nc -N 10.0.2.2 1234; do :; done
    '';
  };

  userData = runCommand "user-data.img" {
    nativeBuildInputs = [ e2fsprogs tar2ext4 ];
  } ''
    tar --transform=s,^${ncVm},vms/nc, -Pcvf root.tar ${ncVm}
    tar2ext4 -i root.tar -o $out
    tune2fs -U a7834806-2f82-4faf-8ac4-4f8fd8a474ca $out
  '';
in

stdenv.mkDerivation (finalAttrs: {
  name = "spectrum-integration-tests";

  src = lib.fileset.toSource {
    root = ../../..;
    fileset = lib.fileset.union
      (lib.fileset.intersection src ./.)
      ../../../scripts/run-qemu.sh;
  };
  sourceRoot = "source/release/checks/integration";

  nativeBuildInputs = [ meson ninja ];
  nativeCheckInputs = [ qemu_kvm ];

  mesonFlags = [
    "-Defi=${qemu_kvm}/share/qemu/edk2-${stdenv.hostPlatform.qemuArch}-code.fd"
    "-Dimg=${live}"
    "-Duser_data=${userData}"
  ];

  doCheck = true;
  dontAddTimeoutMultiplier = true;

  installPhase = ''
    runHook preInstall
    cp meson-logs/testlog.txt $out
    runHook postInstall
  '';

  shellHook = ''
    unset QEMU_SYSTEM
  '';

  env = {
    QEMU_SYSTEM = "qemu-system-${stdenv.hostPlatform.qemuArch} -nographic";
  };

  passthru.tests = {
    clang-tidy = finalAttrs.finalPackage.overrideAttrs (
      { name, src, nativeBuildInputs ? [], ... }:
      {
        name = "${name}-clang-tidy";

        src = lib.fileset.toSource {
          root = ../../..;
          fileset = lib.fileset.union (lib.fileset.fromSource src) ../../../.clang-tidy;
        };

        nativeBuildInputs = nativeBuildInputs ++ [ clang-tools ];

        buildPhase = ''
          clang-tidy --warnings-as-errors='*' -p . ../*.c ../*.h
          touch $out
          exit 0
        '';
      }
    );
  };
})) (_: {})

debug log:

solving 592917c ...
found 592917c in https://inbox.spectrum-os.org/spectrum-devel/20250613140508.76998-4-hi@alyssa.is/
found f2996fd in https://inbox.spectrum-os.org/spectrum-devel/20250613140508.76998-3-hi@alyssa.is/

applying [1/2] https://inbox.spectrum-os.org/spectrum-devel/20250613140508.76998-3-hi@alyssa.is/
diff --git a/release/checks/integration/default.nix b/release/checks/integration/default.nix
new file mode 100644
index 0000000..f2996fd


applying [2/2] https://inbox.spectrum-os.org/spectrum-devel/20250613140508.76998-4-hi@alyssa.is/
diff --git a/release/checks/integration/default.nix b/release/checks/integration/default.nix
index f2996fd..592917c 100644

Checking patch release/checks/integration/default.nix...
Applied patch release/checks/integration/default.nix cleanly.
Checking patch release/checks/integration/default.nix...
Applied patch release/checks/integration/default.nix cleanly.

index at:
100644 592917ccc8c070f2fd404f7b65c3a9ee1147f9f0	release/checks/integration/default.nix

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).