From 1387e36a73873e1f74b2cee267616a2fa37cb28b Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Wed, 20 Sep 2023 22:36:57 +0200 Subject: [PATCH 1/3] gns3-server,gns3-gui: 2.2.42 -> 2.2.43 https://github.com/GNS3/gns3-server/releases/tag/v2.2.43 https://github.com/GNS3/gns3-gui/releases/tag/v2.2.43 --- pkgs/applications/networking/gns3/default.nix | 16 ++++++++-------- pkgs/applications/networking/gns3/gui.nix | 8 ++------ pkgs/applications/networking/gns3/server.nix | 9 +-------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/pkgs/applications/networking/gns3/default.nix b/pkgs/applications/networking/gns3/default.nix index 43aa6e7343a7..bd1b74fe4a74 100644 --- a/pkgs/applications/networking/gns3/default.nix +++ b/pkgs/applications/networking/gns3/default.nix @@ -12,25 +12,25 @@ in { guiStable = mkGui { channel = "stable"; - version = "2.2.42"; - hash = "sha256-FW8Nuha+NrYVhR/66AiBpcCLHRhiLTW8KdHFyWSao84="; + version = "2.2.43"; + hash = "sha256-+2dcyWnTJqGaH9yhknYc9/0gnj3qh80eAy6uxG7+fFM="; }; guiPreview = mkGui { channel = "stable"; - version = "2.2.42"; - hash = "sha256-FW8Nuha+NrYVhR/66AiBpcCLHRhiLTW8KdHFyWSao84="; + version = "2.2.43"; + hash = "sha256-+2dcyWnTJqGaH9yhknYc9/0gnj3qh80eAy6uxG7+fFM="; }; serverStable = mkServer { channel = "stable"; - version = "2.2.42"; - hash = "sha256-YM07krEay2W+/6mKLAg+B7VEnAyDlkD+0+cSO1FAJzA="; + version = "2.2.43"; + hash = "sha256-xWt2qzeqBtt86Wv3dYl4GXkfjr+7WAKn5HdDeUzOQd8="; }; serverPreview = mkServer { channel = "stable"; - version = "2.2.42"; - hash = "sha256-YM07krEay2W+/6mKLAg+B7VEnAyDlkD+0+cSO1FAJzA="; + version = "2.2.43"; + hash = "sha256-xWt2qzeqBtt86Wv3dYl4GXkfjr+7WAKn5HdDeUzOQd8="; }; } diff --git a/pkgs/applications/networking/gns3/gui.nix b/pkgs/applications/networking/gns3/gui.nix index 13764d506697..57228d1a97f6 100644 --- a/pkgs/applications/networking/gns3/gui.nix +++ b/pkgs/applications/networking/gns3/gui.nix @@ -21,7 +21,6 @@ python3.pkgs.buildPythonApplication rec { }; nativeBuildInputs = with python3.pkgs; [ - pythonRelaxDepsHook wrapQtAppsHook ]; @@ -33,11 +32,8 @@ python3.pkgs.buildPythonApplication rec { setuptools sip_4 (pyqt5.override { withWebSockets = true; }) truststore - ]; - - pythonRelaxDeps = [ - "jsonschema" - "sentry-sdk" + ] ++ lib.optionals (pythonOlder "3.9") [ + importlib-resources ]; doCheck = false; # Failing diff --git a/pkgs/applications/networking/gns3/server.nix b/pkgs/applications/networking/gns3/server.nix index 200153b15e03..f8d8d7381ec5 100644 --- a/pkgs/applications/networking/gns3/server.nix +++ b/pkgs/applications/networking/gns3/server.nix @@ -25,14 +25,6 @@ python3.pkgs.buildPythonApplication { cp ${pkgsStatic.busybox}/bin/busybox gns3server/compute/docker/resources/bin/busybox ''; - nativeBuildInputs = with python3.pkgs; [ - pythonRelaxDepsHook - ]; - - pythonRelaxDeps = [ - "jsonschema" - ]; - propagatedBuildInputs = with python3.pkgs; [ aiofiles aiohttp @@ -43,6 +35,7 @@ python3.pkgs.buildPythonApplication { jinja2 jsonschema multidict + platformdirs prompt-toolkit psutil py-cpuinfo From e206ee4cf3b4fd8b5bf848d115b4a6baa305f632 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Wed, 20 Sep 2023 22:37:59 +0200 Subject: [PATCH 2/3] gns3-server,gns3-gui: enable checkPhase --- pkgs/applications/networking/gns3/gui.nix | 16 +++++++++++-- pkgs/applications/networking/gns3/server.nix | 24 +++++++++++++++++--- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/networking/gns3/gui.nix b/pkgs/applications/networking/gns3/gui.nix index 57228d1a97f6..a9537d993171 100644 --- a/pkgs/applications/networking/gns3/gui.nix +++ b/pkgs/applications/networking/gns3/gui.nix @@ -6,6 +6,7 @@ { lib , python3 , fetchFromGitHub +, qt5 , wrapQtAppsHook }: @@ -36,14 +37,25 @@ python3.pkgs.buildPythonApplication rec { importlib-resources ]; - doCheck = false; # Failing - dontWrapQtApps = true; preFixup = '' wrapQtApp "$out/bin/gns3" ''; + doCheck = true; + + checkInputs = with python3.pkgs; [ + pytestCheckHook + ]; + + preCheck = '' + export HOME=$(mktemp -d) + export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}" + export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins"; + export QT_QPA_PLATFORM=offscreen + ''; + meta = with lib; { description = "Graphical Network Simulator 3 GUI (${channel} release)"; longDescription = '' diff --git a/pkgs/applications/networking/gns3/server.nix b/pkgs/applications/networking/gns3/server.nix index f8d8d7381ec5..98ae803492f0 100644 --- a/pkgs/applications/networking/gns3/server.nix +++ b/pkgs/applications/networking/gns3/server.nix @@ -46,13 +46,31 @@ python3.pkgs.buildPythonApplication { zipstream ]; - # Requires network access - doCheck = false; - postInstall = '' rm $out/bin/gns3loopback # For Windows only ''; + doCheck = true; + + # Otherwise tests will fail to create directory + # Permission denied: '/homeless-shelter' + preCheck = '' + export HOME=$(mktemp -d) + ''; + + checkInputs = with python3.pkgs; [ + pytest-aiohttp + pytest-rerunfailures + pytestCheckHook + ]; + + pytestFlagsArray = [ + # fails on ofborg because of lack of cpu vendor information + "--deselect=tests/controller/gns3vm/test_virtualbox_gns3_vm.py::test_cpu_vendor_id" + # Rerun failed tests up to three times (flaky tests) + "--reruns 3" + ]; + meta = with lib; { description = "Graphical Network Simulator 3 server (${channel} release)"; longDescription = '' From 62eb1578944f01e36264129b1d2342251f346787 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Wed, 20 Sep 2023 22:41:03 +0200 Subject: [PATCH 3/3] gns3-server: keep gns3loopack on windows host platforms --- pkgs/applications/networking/gns3/server.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/gns3/server.nix b/pkgs/applications/networking/gns3/server.nix index 98ae803492f0..48d48de83b2a 100644 --- a/pkgs/applications/networking/gns3/server.nix +++ b/pkgs/applications/networking/gns3/server.nix @@ -7,6 +7,7 @@ , python3 , fetchFromGitHub , pkgsStatic +, stdenv }: python3.pkgs.buildPythonApplication { @@ -46,8 +47,8 @@ python3.pkgs.buildPythonApplication { zipstream ]; - postInstall = '' - rm $out/bin/gns3loopback # For Windows only + postInstall = lib.optionalString (!stdenv.hostPlatform.isWindows) '' + rm $out/bin/gns3loopback ''; doCheck = true;