Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PrivateStorage
PrivateStorageio
Commits
35fb7572
Commit
35fb7572
authored
Aug 25, 2021
by
Florian Sesser
Browse files
Options
Downloads
Patches
Plain Diff
Fix system tests
Write Python with Nix (?).
parent
39897183
No related branches found
No related tags found
3 merge requests
!180
merge develop into production
,
!177
merge develop into staging
,
!151
Upgrade system test software and port system tests from Perl to Python
Pipeline
#967
passed
Aug 25, 2021
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
nixos/modules/tests/private-storage.nix
+17
-15
17 additions, 15 deletions
nixos/modules/tests/private-storage.nix
with
17 additions
and
15 deletions
nixos/modules/tests/private-storage.nix
+
17
−
15
View file @
35fb7572
...
@@ -82,11 +82,7 @@ let
...
@@ -82,11 +82,7 @@ let
let
let
command
=
builtins
.
concatStringsSep
" "
argv
;
command
=
builtins
.
concatStringsSep
" "
argv
;
in
in
"
"
${
node
}
.succeed('set -eo pipefail;
${
command
}
| systemd-cat')"
;
\$
${
node
}
->succeed('set -eo pipefail;
${
command
}
| systemd-cat');
# succeed() is not success but 1 is.
1;
"
;
pspkgs
=
import
../../../nixpkgs-ps.nix
{
};
pspkgs
=
import
../../../nixpkgs-ps.nix
{
};
...
@@ -199,17 +195,17 @@ in {
...
@@ -199,17 +195,17 @@ in {
# doesn't prove it is so but if it fails it's a pretty good indication
# doesn't prove it is so but if it fails it's a pretty good indication
# it isn't so.
# it isn't so.
storage.wait_for_open_port(22)
storage.wait_for_open_port(22)
issuer.succeed("
ssh probeuser
@
storage")
${
runOnNode
"issuer"
(
ssh
"
probeuser
"
"
storage"
)
}
issuer.succeed("
ssh root
@
storage")
${
runOnNode
"issuer"
(
ssh
"
root
"
"
storage"
)
}
issuer.wait_for_open_port(22)
issuer.wait_for_open_port(22)
storage.succeed("
ssh probeuser
@
issuer")
${
runOnNode
"storage"
(
ssh
"
probeuser
"
"
issuer"
)
}
storage.succeed("
ssh root
@
issuer")
${
runOnNode
"storage"
(
ssh
"
root
"
"
issuer"
)
}
# Set up a Tahoe-LAFS introducer.
# Set up a Tahoe-LAFS introducer.
introducer.copy_from_host('
${
pemFile
}
', '/tmp/node.pem')
introducer.copy_from_host('
${
pemFile
}
', '/tmp/node.pem')
try:
try:
introducer.succeed('
run-introducer /tmp/node.pem
${
toString
introducerPort
}
${
introducerFURL
}
')
${
runOnNode
"introducer"
[
run-introducer
"
/tmp/node.pem
"
(
toString
introducerPort
)
introducerFURL
]
}
except:
except:
code, log = introducer.execute('cat /tmp/stdout /tmp/stderr')
code, log = introducer.execute('cat /tmp/stdout /tmp/stderr')
introducer.log(log)
introducer.log(log)
...
@@ -239,7 +235,7 @@ in {
...
@@ -239,7 +235,7 @@ in {
#
#
# Storage appears to be working so try to get a client to speak with it.
# Storage appears to be working so try to get a client to speak with it.
#
#
client.succeed('
run-client /tmp/client
${
introducerFURL
}
${
issuerURL
}
')
${
runOnNode
"client"
[
run-client
"
/tmp/client
"
introducerFURL
issuerURL
]
}
client.wait_for_open_port(3456)
client.wait_for_open_port(3456)
# Make sure the fake Stripe API server is ready for requests.
# Make sure the fake Stripe API server is ready for requests.
...
@@ -252,7 +248,13 @@ in {
...
@@ -252,7 +248,13 @@ in {
# Get some ZKAPs from the issuer.
# Get some ZKAPs from the issuer.
try:
try:
client.succeed('get-passes http://127.0.0.1:3456 /tmp/client/private/api_auth_token
${
issuerURL
}
${
voucher
}
')
${
runOnNode
"client"
[
get-passes
"http://127.0.0.1:3456"
"/tmp/client/private/api_auth_token"
issuerURL
voucher
]
}
except:
except:
code, log = client.execute('cat /tmp/stdout /tmp/stderr');
code, log = client.execute('cat /tmp/stdout /tmp/stderr');
client.log(log)
client.log(log)
...
@@ -265,7 +267,7 @@ in {
...
@@ -265,7 +267,7 @@ in {
# The client should be prepped now. Make it try to use some storage.
# The client should be prepped now. Make it try to use some storage.
try:
try:
client.succeed('
exercise-storage /tmp/client
')
${
runOnNode
"client"
[
exercise-storage
"
/tmp/client
"
]
}
except:
except:
code, log = client.execute('cat /tmp/stdout /tmp/stderr')
code, log = client.execute('cat /tmp/stdout /tmp/stderr')
client.log(log)
client.log(log)
...
@@ -276,7 +278,7 @@ in {
...
@@ -276,7 +278,7 @@ in {
try:
try:
furlfile = '/var/db/tahoe-lafs/storage/private/storage-plugin.privatestorageio-zkapauthz-v1.furl'
furlfile = '/var/db/tahoe-lafs/storage/private/storage-plugin.privatestorageio-zkapauthz-v1.furl'
before = storage.execute('cat ' + furlfile)
before = storage.execute('cat ' + furlfile)
storage.succeed('
systemctl
restart
tahoe.storage
')
${
runOnNode
"storage"
[
"
systemctl
"
"
restart
"
"
tahoe.storage
"
]
}
after = storage.execute('cat ' + furlfile)
after = storage.execute('cat ' + furlfile)
if (before != after):
if (before != after):
raise Exception('fURL changes after storage node restart')
raise Exception('fURL changes after storage node restart')
...
@@ -287,7 +289,7 @@ in {
...
@@ -287,7 +289,7 @@ in {
# The client should actually still work, too.
# The client should actually still work, too.
try:
try:
client.succeed('
exercise-storage /tmp/client
')
${
runOnNode
"client"
[
exercise-storage
"
/tmp/client
"
]
}
except:
except:
code, log = client.execute('cat /tmp/stdout /tmp/stderr')
code, log = client.execute('cat /tmp/stdout /tmp/stderr')
client.log(log)
client.log(log)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment