Merge branch 'master' into staging-next

This commit is contained in:
Jan Tojnar 2022-03-25 15:03:47 +01:00
commit d246548329
26 changed files with 119 additions and 40 deletions

View file

@ -158,6 +158,12 @@ The following methods are available on machine objects:
e.g., `send_chars("foobar\n")` will type the string `foobar`
followed by the Enter key.
`send_console`
: Send keys to the kernel console. This allows interaction with the systemd
emergency mode, for example. Takes a string that is sent, e.g.,
`send_console("\n\nsystemctl default\n")`.
`execute`
: Execute a shell command, returning a list `(status, stdout)`.
@ -272,6 +278,13 @@ The following methods are available on machine objects:
Killing the interactive session with `Ctrl-d` or `Ctrl-c` also ends
the guest session.
`console_interact`
: Allows you to directly interact with QEMU's stdin. This should
only be used during test development, not in production tests.
Output from QEMU is only read line-wise. `Ctrl-c` kills QEMU and
`Ctrl-d` closes console and returns to the test runner.
To test user units declared by `systemd.user.services` the optional
`user` argument can be used:

View file

@ -261,6 +261,19 @@ start_all()
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>send_console</literal>
</term>
<listitem>
<para>
Send keys to the kernel console. This allows interaction
with the systemd emergency mode, for example. Takes a string
that is sent, e.g.,
<literal>send_console(&quot;\n\nsystemctl default\n&quot;)</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>execute</literal>
@ -502,6 +515,21 @@ machine.systemctl(&quot;list-jobs --no-pager&quot;, &quot;any-user&quot;) # spaw
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>console_interact</literal>
</term>
<listitem>
<para>
Allows you to directly interact with QEMUs stdin. This
should only be used during test development, not in
production tests. Output from QEMU is only read line-wise.
<literal>Ctrl-c</literal> kills QEMU and
<literal>Ctrl-d</literal> closes console and returns to the
test runner.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
To test user units declared by

View file

@ -198,7 +198,7 @@ class StartCommand:
) -> subprocess.Popen:
return subprocess.Popen(
self.cmd(monitor_socket_path, shell_socket_path),
stdin=subprocess.DEVNULL,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True,
@ -558,6 +558,28 @@ class Machine:
pass_fds=[self.shell.fileno()],
)
def console_interact(self) -> None:
"""Allows you to interact with QEMU's stdin
The shell can be exited with Ctrl+D. Note that Ctrl+C is not allowed to be used.
QEMU's stdout is read line-wise.
Should only be used during test development, not in the production test."""
self.log("Terminal is ready (there is no prompt):")
assert self.process
assert self.process.stdin
while True:
try:
char = sys.stdin.buffer.read(1)
except KeyboardInterrupt:
break
if char == b"": # ctrl+d
self.log("Closing connection to the console")
break
self.send_console(char.decode())
def succeed(self, *commands: str, timeout: Optional[int] = None) -> str:
"""Execute each command and check that it succeeds."""
output = ""
@ -834,6 +856,12 @@ class Machine:
self.send_monitor_command("sendkey {}".format(key))
time.sleep(0.01)
def send_console(self, chars: str) -> None:
assert self.process
assert self.process.stdin
self.process.stdin.write(chars.encode())
self.process.stdin.flush()
def start(self) -> None:
if self.booted:
return

View file

@ -5,14 +5,14 @@
python3Packages.buildPythonApplication rec {
pname = "flexget";
version = "3.3.3";
version = "3.3.4";
# Fetch from GitHub in order to use `requirements.in`
src = fetchFromGitHub {
owner = "flexget";
repo = "flexget";
rev = "v${version}";
hash = "sha256-a76x4Klad3lct2M9RxSroUYKmEX7lPqDN+dFvfjavo8=";
hash = "sha256-/nuY8+/RMM7ASke+NXb95yu+FeQHawCdgqVsBrk/KZ8=";
};
postPatch = ''

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, qtest, num, ounit
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, qtest, qcheck, num, ounit
, doCheck ? lib.versionAtLeast ocaml.version "4.08" && !stdenv.isAarch64
}:
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
checkInputs = [ qtest ounit ];
checkInputs = [ qtest ounit qcheck ];
propagatedBuildInputs = [ num ];
strictDeps = !doCheck;

View file

@ -15,8 +15,7 @@ buildDunePackage rec {
sha256 = "2a37ffaa352a1e145ef3d80ac28661213c69a741b238623e59f29e3d5a12c537";
};
buildInputs = [ ppx_sexp_conv ];
propagatedBuildInputs = [ astring ipaddr ipaddr-sexp sexplib uri logs ];
propagatedBuildInputs = [ astring ipaddr ipaddr-sexp sexplib uri logs ppx_sexp_conv ];
meta = {
description = "A network connection establishment library";

View file

@ -8,9 +8,9 @@ stdenv.mkDerivation rec {
sha256 = "1nymykskq1yx87y4xl6hl9i4q6kv0qaq25rniqgl1bfn883p1ysc";
};
nativeBuildInputs = [ perl ocaml findlib ];
nativeBuildInputs = [ perl ocaml findlib camlidl ];
propagatedBuildInputs = [ apron camlidl gmp mpfr ];
propagatedBuildInputs = [ apron gmp mpfr ];
strictDeps = true;

View file

@ -1,11 +1,9 @@
{ lib, fetchurl, buildDunePackage }:
{ lib, fetchurl, buildDunePackage, ocaml }:
buildDunePackage rec {
pname = "facile";
version = "1.1.4";
useDune2 = false;
src = fetchurl {
url = "https://github.com/Emmanuel-PLF/facile/releases/download/${version}/facile-${version}.tbz";
sha256 = "0jqrwmn6fr2vj2rrbllwxq4cmxykv7zh0y4vnngx29f5084a04jp";
@ -13,6 +11,9 @@ buildDunePackage rec {
doCheck = true;
useDune2 = lib.versionAtLeast ocaml.version "4.12";
postPatch = lib.optionalString useDune2 "dune upgrade";
meta = {
homepage = "http://opti.recherche.enac.fr/facile/";
license = lib.licenses.lgpl21Plus;

View file

@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
'';
nativeBuildInputs = [ pkg-config ocaml findlib ];
buildInputs = [ gdome2 libxslt];
propagatedBuildInputs = [gdome2];
buildInputs = [ libxslt ];
propagatedBuildInputs = [ gdome2 ];
strictDeps = true;

View file

@ -15,7 +15,7 @@ buildDunePackage rec {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ core core_kernel sqlite ];
propagatedBuildInputs = [ core core_kernel sqlite ];
meta = {
description =

View file

@ -13,7 +13,7 @@ buildDunePackage rec {
useDune2 = true;
buildInputs = [
propagatedBuildInputs = [
cudf
];

View file

@ -1,6 +1,6 @@
{ lib, fetchurl, buildDunePackage
, logs, lwt, mirage-clock, mirage-profile, ptime
, alcotest
, alcotest, stdlib-shims
}:
buildDunePackage rec {
@ -14,7 +14,7 @@ buildDunePackage rec {
sha256 = "0h0amzjxy067jljscib7fvw5q8k0adqa8m86affha9hq5jsh07a1";
};
propagatedBuildInputs = [ logs lwt mirage-clock mirage-profile ptime ];
propagatedBuildInputs = [ logs lwt mirage-clock mirage-profile ptime stdlib-shims ];
doCheck = true;
checkInputs = [ alcotest ];

View file

@ -1,5 +1,5 @@
{ lib, fetchurl, buildDunePackage
, ppx_cstruct
, ppx_cstruct, stdlib-shims
, cstruct, lwt
}:
@ -15,7 +15,7 @@ buildDunePackage rec {
};
buildInputs = [ ppx_cstruct ];
propagatedBuildInputs = [ cstruct lwt ];
propagatedBuildInputs = [ cstruct lwt stdlib-shims ];
meta = with lib; {
description = "Collect runtime profiling information in CTF format";

View file

@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
sha256 = "17xqiclaqs4hmnb92p9z6z9a1xfr31vcn8nlnj8ykk57by31vfza";
};
nativeBuildInputs = [ perl ocaml findlib mpfr camlidl ];
nativeBuildInputs = [ perl ocaml findlib camlidl ];
buildInputs = [ gmp mpfr ];
strictDeps = true;
@ -22,8 +22,7 @@ stdenv.mkDerivation rec {
];
postConfigure = ''
sed -i Makefile \
-e 's|/bin/rm|rm|'
substituteInPlace Makefile --replace "/bin/rm" "rm"
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
'';

View file

@ -1,11 +1,9 @@
{ lib, fetchzip, buildDunePackage }:
{ lib, fetchzip, buildDunePackage, ocaml }:
buildDunePackage rec {
pname = "nonstd";
version = "0.0.3";
useDune2 = false;
minimalOCamlVersion = "4.02";
src = fetchzip {
@ -13,6 +11,8 @@ buildDunePackage rec {
sha256 = "0ccjwcriwm8fv29ij1cnbc9win054kb6pfga3ygzdbjpjb778j46";
};
useDune2 = lib.versionAtLeast ocaml.version "4.12";
postPatch = lib.optionalString useDune2 "dune upgrade";
doCheck = true;
meta = with lib; {

View file

@ -23,7 +23,7 @@ buildDunePackage rec {
useDune2 = true;
buildInputs = [ astring result ];
propagatedBuildInputs = [ astring result ];
meta = {
description = "Parser for Ocaml documentation comments";

View file

@ -9,6 +9,7 @@
, ezjsonm
, hmap
, sexplib
, fieldslib
}:
buildDunePackage rec {
@ -31,7 +32,7 @@ buildDunePackage rec {
];
propagatedBuildInputs = [
hmap cohttp-lwt ezjsonm sexplib
hmap cohttp-lwt ezjsonm sexplib fieldslib
];
meta = {

View file

@ -1,6 +1,6 @@
{ lib, buildDunePackage, fetchurl
, ppx_cstruct, ppx_tools
, cstruct, ounit, mmap
, cstruct, ounit, mmap, stdlib-shims
}:
buildDunePackage rec {
@ -24,6 +24,7 @@ buildDunePackage rec {
propagatedBuildInputs = [
cstruct
stdlib-shims
];
doCheck = true;

View file

@ -15,7 +15,7 @@ buildOcaml rec {
strictDeps = true;
buildInputs = [ camlp4 ];
propagatedBuildInputs = [ camlp4 ];
meta = with lib; {
homepage = "https://github.com/janestreet/pipebang";

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, piqi, stdlib-shims }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, piqi, stdlib-shims, num }:
stdenv.mkDerivation rec {
version = "0.7.7";
@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ ocaml findlib ];
buildInputs = [ piqi stdlib-shims ];
checkInputs = [ num ];
strictDeps = true;
createFindlibDestdir = true;

View file

@ -27,17 +27,19 @@ buildDunePackage rec {
sha256 = "15cjb9ygnvp2kv85rrb7ncz7yalifyl7wd2hp2cl8r1qrpgi1d0w";
};
nativeBuildInputs = [ cppo ];
nativeBuildInputs = [ cppo findlib ];
buildInputs = [
bigarray-compat
containers
ctypes
integers
num
ppxlib
re
findlib
];
propagatedBuildInputs = [
ctypes
];
strictDeps = true;

View file

@ -1,5 +1,5 @@
{ lib, fetchurl, buildDunePackage, cppo, ppx_deriving
, ppxlib
, ppxlib, dune-configurator
}:
buildDunePackage rec {
@ -13,7 +13,9 @@ buildDunePackage rec {
sha256 = "1dc1vxnkd0cnrgac5v3zbaj2lq1d2w8118mp1cmsdxylp06yz1sj";
};
buildInputs = [ cppo ppxlib ppx_deriving ];
nativeBuildInputs = [ cppo ];
buildInputs = [ ppxlib dune-configurator ];
propagatedBuildInputs = [ ppx_deriving ];
meta = with lib; {
homepage = "https://github.com/ocaml-ppx/ppx_deriving_protobuf";

View file

@ -5,6 +5,7 @@
, mirage-profile
, cstruct
, ounit
, stdlib-shims
}:
buildDunePackage rec {
@ -25,6 +26,7 @@ buildDunePackage rec {
propagatedBuildInputs = [
mirage-profile
cstruct
stdlib-shims
];
doCheck = true;

View file

@ -26,6 +26,7 @@ stdenv.mkDerivation rec {
createFindlibDestdir = true;
nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ];
propagatedBuildInputs = [ camlp4 ];
strictDeps = true;

View file

@ -7,14 +7,14 @@
buildPythonPackage rec {
pname = "asyncsleepiq";
version = "1.2.0";
version = "1.2.1";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-bE9eOjOLERnioOunIBN7Hc/Nvs1zDXMSMzqZsVRg6Jo=";
sha256 = "sha256-pIfEdNmtnwA+PE3lXVd7Qd8Igj+/aqZmuDqFs60PxgY=";
};
propagatedBuildInputs = [

View file

@ -7,8 +7,8 @@ let
in
buildNodejs {
inherit enableNpm;
version = "17.7.2";
sha256 = "sha256-OuXnTgsWIoz37faIU1mp0uAZrIQ5BsXgGUjXRvq6Sq8=";
version = "17.8.0";
sha256 = "0jsf6sv42rzpizvil7g1gf9bskh8lx0gcxg0yzpr4hk7mx7i90br";
patches = [
./disable-darwin-v8-system-instrumentation.patch
];