mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
Merge pull request #74003 from nh2/nixos-tests-port-glusterfs
nixosTests.glusterfs: port to python
This commit is contained in:
commit
6e60f849db
@ -1,4 +1,4 @@
|
||||
import ./make-test.nix ({ ... } :
|
||||
import ./make-test-python.nix ({pkgs, lib, ...}:
|
||||
|
||||
let
|
||||
client = { pkgs, ... } : {
|
||||
@ -39,27 +39,29 @@ in {
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
$server1->waitForUnit("glusterd.service");
|
||||
$server2->waitForUnit("glusterd.service");
|
||||
server1.wait_for_unit("glusterd.service")
|
||||
server2.wait_for_unit("glusterd.service")
|
||||
|
||||
server1.wait_until_succeeds("gluster peer status")
|
||||
server2.wait_until_succeeds("gluster peer status")
|
||||
|
||||
# establish initial contact
|
||||
$server1->succeed("sleep 2");
|
||||
$server1->succeed("gluster peer probe server2");
|
||||
$server1->succeed("gluster peer probe server1");
|
||||
server1.succeed("gluster peer probe server2")
|
||||
server1.succeed("gluster peer probe server1")
|
||||
|
||||
$server1->succeed("gluster peer status | grep Connected");
|
||||
server1.succeed("gluster peer status | grep Connected")
|
||||
|
||||
# create volumes
|
||||
$server1->succeed("mkdir -p /data/vg0");
|
||||
$server2->succeed("mkdir -p /data/vg0");
|
||||
$server1->succeed("gluster volume create gv0 server1:/data/vg0 server2:/data/vg0");
|
||||
$server1->succeed("gluster volume start gv0");
|
||||
server1.succeed("mkdir -p /data/vg0")
|
||||
server2.succeed("mkdir -p /data/vg0")
|
||||
server1.succeed("gluster volume create gv0 server1:/data/vg0 server2:/data/vg0")
|
||||
server1.succeed("gluster volume start gv0")
|
||||
|
||||
# test clients
|
||||
$client1->waitForUnit("gluster.mount");
|
||||
$client2->waitForUnit("gluster.mount");
|
||||
client1.wait_for_unit("gluster.mount")
|
||||
client2.wait_for_unit("gluster.mount")
|
||||
|
||||
$client1->succeed("echo test > /gluster/file1");
|
||||
$client2->succeed("grep test /gluster/file1");
|
||||
client1.succeed("echo test > /gluster/file1")
|
||||
client2.succeed("grep test /gluster/file1")
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user