From 23eb10ee7580d4d78df6f6eed9234081d3931fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Thu, 24 Jul 2025 19:35:09 -0400 Subject: [PATCH] Add test for Ctrl+C behavior --- spec/IntegrationSpec.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/IntegrationSpec.hs b/spec/IntegrationSpec.hs index 1bcc724..d35396f 100644 --- a/spec/IntegrationSpec.hs +++ b/spec/IntegrationSpec.hs @@ -99,6 +99,13 @@ spec = do cs (stderr result) `shouldContain` "Building NixOS config...\nCommand exited with code 1" cs (stderr result) `shouldContain` "does not provide attribute 'packages.x86_64-linux.nixosConfigurations.\"does-not-exist\"" + it "`vmcli start` doesn't mess up the terminal" $ \ctx -> do + writeStandardFlake ctx Nothing + Cradle.StdoutRaw before <- Cradle.run $ Cradle.cmd "stty" & Cradle.addArgs ["-a" :: Text] + _ <- assertSuccess $ test ctx ["start", "server"] + Cradle.StdoutRaw after <- Cradle.run $ Cradle.cmd "stty" & Cradle.addArgs ["-a" :: Text] + after `shouldBe` before + it "starts vms with arbitrary hostnames" $ \ctx -> do writeStandardFlake ctx (Just "{ lib, ...} : { networking.hostName = lib.mkForce \"other-hostname\"; }") _ <- assertSuccess $ test ctx ["up", "server"]