-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
stratis-cli: init at 3.2.0 #186940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
stratis-cli: init at 3.2.0 #186940
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
096aba3
python3Packages.hs-dbus-signature: init at 0.7
NickCao dc168de
python3Packages.dbus-signature-pyparsing: init at 0.04
NickCao de6160d
python3Packages.into-dbus-python: init at 0.08
NickCao 91dee8a
python3Packages.dbus-python-client-gen: init at 0.8
NickCao bb307c9
stratis-cli: init at 3.2.0
NickCao ca03f2d
nixos/stratis: init
NickCao 4abf0ee
nixos/stratis: add test for simple usecases
NickCao 7398c33
nixos/stratis: passthru tests to stratis-cli and stratisd
NickCao 6ec928d
nixos/stratis: wait for devices to appear in tests
NickCao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { config, lib, pkgs, ... }: | ||
|
|
||
| let | ||
| cfg = config.services.stratis; | ||
| in | ||
| { | ||
| options.services.stratis = { | ||
| enable = lib.mkEnableOption (lib.mdDoc "Stratis Storage - Easy to use local storage management for Linux"); | ||
| }; | ||
|
|
||
| config = lib.mkIf cfg.enable { | ||
| environment.systemPackages = [ pkgs.stratis-cli ]; | ||
| systemd.packages = [ pkgs.stratisd ]; | ||
| services.dbus.packages = [ pkgs.stratisd ]; | ||
| services.udev.packages = [ pkgs.stratisd ]; | ||
| systemd.services.stratisd.wantedBy = [ "sysinit.target" ]; | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { system ? builtins.currentSystem | ||
| , pkgs ? import ../../.. { inherit system; } | ||
| }: | ||
|
|
||
| { | ||
| simple = import ./simple.nix { inherit system pkgs; }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import ../make-test-python.nix ({ pkgs, ... }: | ||
| { | ||
| name = "stratis"; | ||
|
|
||
| meta = with pkgs.lib.maintainers; { | ||
| maintainers = [ nickcao ]; | ||
| }; | ||
|
|
||
| nodes.machine = { pkgs, ... }: { | ||
| services.stratis.enable = true; | ||
| virtualisation.emptyDiskImages = [ 1024 1024 1024 1024 ]; | ||
| }; | ||
|
|
||
| testScript = '' | ||
| machine.wait_for_unit("stratisd") | ||
| # test pool creation | ||
| machine.succeed("stratis pool create testpool /dev/vdb") | ||
| machine.succeed("stratis pool add-data testpool /dev/vdc") | ||
| machine.succeed("stratis pool init-cache testpool /dev/vdd") | ||
| machine.succeed("stratis pool add-cache testpool /dev/vde") | ||
| # test filesystem creation and rename | ||
| machine.succeed("stratis filesystem create testpool testfs0") | ||
| machine.succeed("stratis filesystem rename testpool testfs0 testfs1") | ||
| # test snapshot | ||
| machine.succeed("mkdir -p /mnt/testfs1 /mnt/testfs2") | ||
| machine.wait_for_file("/dev/stratis/testpool/testfs1") | ||
| machine.succeed("mount /dev/stratis/testpool/testfs1 /mnt/testfs1") | ||
| machine.succeed("echo test0 > /mnt/testfs1/test0") | ||
| machine.succeed("echo test1 > /mnt/testfs1/test1") | ||
| machine.succeed("stratis filesystem snapshot testpool testfs1 testfs2") | ||
| machine.succeed("echo test2 > /mnt/testfs1/test1") | ||
| machine.wait_for_file("/dev/stratis/testpool/testfs2") | ||
| machine.succeed("mount /dev/stratis/testpool/testfs2 /mnt/testfs2") | ||
| assert "test0" in machine.succeed("cat /mnt/testfs1/test0") | ||
| assert "test0" in machine.succeed("cat /mnt/testfs2/test0") | ||
| assert "test2" in machine.succeed("cat /mnt/testfs1/test1") | ||
| assert "test1" in machine.succeed("cat /mnt/testfs2/test1") | ||
| ''; | ||
| }) |
34 changes: 34 additions & 0 deletions
34
pkgs/development/python-modules/dbus-python-client-gen/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { lib | ||
| , buildPythonPackage | ||
| , fetchFromGitHub | ||
| , into-dbus-python | ||
| , dbus-python | ||
| , pytestCheckHook | ||
| }: | ||
|
|
||
| buildPythonPackage rec { | ||
| pname = "dbus-python-client-gen"; | ||
| version = "0.8"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "stratis-storage"; | ||
| repo = pname; | ||
| rev = "v${version}"; | ||
| hash = "sha256-nSzxT65WHBVct5pGHmIAHJXftd0tKZeK/argN+V9xcs="; | ||
| }; | ||
|
|
||
| propagatedBuildInputs = [ | ||
| into-dbus-python | ||
| dbus-python | ||
| ]; | ||
| checkInputs = [ | ||
| pytestCheckHook | ||
| ]; | ||
|
|
||
| meta = with lib; { | ||
| description = "A Python library for generating dbus-python client code"; | ||
| homepage = "https://github.com/stratis-storage/dbus-python-client-gen"; | ||
| license = licenses.mpl20; | ||
| maintainers = with maintainers; [ nickcao ]; | ||
| }; | ||
| } | ||
34 changes: 34 additions & 0 deletions
34
pkgs/development/python-modules/dbus-signature-pyparsing/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { lib | ||
| , buildPythonPackage | ||
| , fetchFromGitHub | ||
| , pyparsing | ||
| , pytestCheckHook | ||
| , hypothesis | ||
| , hs-dbus-signature | ||
| }: | ||
|
|
||
| buildPythonPackage rec { | ||
| pname = "dbus-signature-pyparsing"; | ||
| version = "0.04"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "stratis-storage"; | ||
| repo = pname; | ||
| rev = "v${version}"; | ||
| hash = "sha256-IXyepfq7pLTRkTolKWsKGrYDoxukVC9JTrxS9xV7s2I="; | ||
| }; | ||
|
|
||
| propagatedBuildInputs = [ pyparsing ]; | ||
| checkInputs = [ | ||
| pytestCheckHook | ||
| hypothesis | ||
| hs-dbus-signature | ||
| ]; | ||
|
|
||
NickCao marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| meta = with lib; { | ||
| description = "A Parser for a D-Bus Signature"; | ||
| homepage = "https://github.com/stratis-storage/dbus-signature-pyparsing"; | ||
| license = licenses.asl20; | ||
| maintainers = with maintainers; [ nickcao ]; | ||
| }; | ||
| } | ||
28 changes: 28 additions & 0 deletions
28
pkgs/development/python-modules/hs-dbus-signature/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { lib | ||
| , buildPythonPackage | ||
| , fetchPypi | ||
| , pytestCheckHook | ||
| , hypothesis | ||
| }: | ||
|
|
||
| buildPythonPackage rec { | ||
| pname = "hs-dbus-signature"; | ||
| version = "0.7"; | ||
|
|
||
| src = fetchPypi { | ||
| inherit pname version; | ||
| hash = "sha256-NNnTcSX+K8zU+sj1QBd13h7aEXN9VqltJMNWCuhgZ6I="; | ||
| }; | ||
|
|
||
| checkInputs = [ | ||
| pytestCheckHook | ||
| hypothesis | ||
| ]; | ||
|
|
||
NickCao marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| meta = with lib; { | ||
| description = "A Hypothesis Strategy for Generating Arbitrary DBus Signatures"; | ||
| homepage = "https://github.com/stratis-storage/hs-dbus-signature"; | ||
| license = licenses.mpl20; | ||
| maintainers = with maintainers; [ nickcao ]; | ||
| }; | ||
| } | ||
38 changes: 38 additions & 0 deletions
38
pkgs/development/python-modules/into-dbus-python/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { lib | ||
| , buildPythonPackage | ||
| , fetchFromGitHub | ||
| , dbus-signature-pyparsing | ||
| , dbus-python | ||
| , pytestCheckHook | ||
| , hypothesis | ||
| , hs-dbus-signature | ||
| }: | ||
|
|
||
| buildPythonPackage rec { | ||
| pname = "into-dbus-python"; | ||
| version = "0.08"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "stratis-storage"; | ||
| repo = pname; | ||
| rev = "v${version}"; | ||
| hash = "sha256-Z8e6oAvRMIisMjG4HcS5jSH1znGVc7pGpMITo5fXYVs="; | ||
| }; | ||
|
|
||
| propagatedBuildInputs = [ | ||
| dbus-signature-pyparsing | ||
| dbus-python | ||
| ]; | ||
| checkInputs = [ | ||
| pytestCheckHook | ||
| hypothesis | ||
| hs-dbus-signature | ||
| ]; | ||
|
|
||
NickCao marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| meta = with lib; { | ||
| description = "A transformer to dbus-python types"; | ||
| homepage = "https://github.com/stratis-storage/into-dbus-python"; | ||
| license = licenses.asl20; | ||
| maintainers = with maintainers; [ nickcao ]; | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { lib | ||
| , python3Packages | ||
| , fetchFromGitHub | ||
| , nixosTests | ||
| }: | ||
|
|
||
| python3Packages.buildPythonApplication rec { | ||
| pname = "stratis-cli"; | ||
| version = "3.2.0"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "stratis-storage"; | ||
| repo = pname; | ||
| rev = "v${version}"; | ||
| hash = "sha256-JQXTzvm4l/pl2T4djZ3HEdDQJdFE+I9doe8Iv5q34kw="; | ||
| }; | ||
|
|
||
| propagatedBuildInputs = with python3Packages; [ | ||
| psutil | ||
| python-dateutil | ||
| wcwidth | ||
| justbytes | ||
| dbus-client-gen | ||
| dbus-python-client-gen | ||
| packaging | ||
| ]; | ||
|
|
||
NickCao marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| passthru.tests = nixosTests.stratis; | ||
|
|
||
| meta = with lib; { | ||
| description = "CLI for the Stratis project"; | ||
| homepage = "https://stratis-storage.github.io"; | ||
| license = licenses.asl20; | ||
| maintainers = with maintainers; [ nickcao ]; | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.