Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nix
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nora Puchreiner
Nix
Commits
aa23bba2
Unverified
Commit
aa23bba2
authored
8 years ago
by
Eelco Dolstra
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests to reflect the signed-binary-caches default change
parent
e1e49c58
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/manual/command-ref/conf-file.xml
+4
-3
4 additions, 3 deletions
doc/manual/command-ref/conf-file.xml
tests/binary-cache.sh
+5
-5
5 additions, 5 deletions
tests/binary-cache.sh
tests/repair.sh
+2
-2
2 additions, 2 deletions
tests/repair.sh
with
11 additions
and
10 deletions
doc/manual/command-ref/conf-file.xml
+
4
−
3
View file @
aa23bba2
...
@@ -394,9 +394,10 @@ flag, e.g. <literal>--option gc-keep-outputs false</literal>.</para>
...
@@ -394,9 +394,10 @@ flag, e.g. <literal>--option gc-keep-outputs false</literal>.</para>
<varlistentry><term><literal>
signed-binary-caches
</literal></term>
<varlistentry><term><literal>
signed-binary-caches
</literal></term>
<listitem><para>
If set to
<literal>
*
</literal>
, Nix will only
<listitem><para>
If set to
<literal>
*
</literal>
(the default), Nix
download binaries if they are signed using one of the keys listed
will only download binaries if they are signed using one of the
in
<option>
binary-cache-public-keys
</option>
.
</para></listitem>
keys listed in
<option>
binary-cache-public-keys
</option>
. Set to
the empty string to disable signature checking.
</para></listitem>
</varlistentry>
</varlistentry>
...
...
This diff is collapsed.
Click to expand it.
tests/binary-cache.sh
+
5
−
5
View file @
aa23bba2
...
@@ -18,7 +18,7 @@ basicTests() {
...
@@ -18,7 +18,7 @@ basicTests() {
nix-env
--option
binary-caches
"file://
$cacheDir
"
-f
dependencies.nix
-qas
\*
|
grep
--
"---"
nix-env
--option
binary-caches
"file://
$cacheDir
"
-f
dependencies.nix
-qas
\*
|
grep
--
"---"
nix-store
--option
binary-caches
"file://
$cacheDir
"
-r
$outPath
nix-store
--option
binary-caches
"file://
$cacheDir
"
--option
signed-binary-caches
''
-r
$outPath
[
-x
$outPath
/program
]
[
-x
$outPath
/program
]
...
@@ -34,7 +34,7 @@ basicTests() {
...
@@ -34,7 +34,7 @@ basicTests() {
x
=
$(
nix-env
-f
dependencies.nix
-qas
\*
--prebuilt-only
)
x
=
$(
nix-env
-f
dependencies.nix
-qas
\*
--prebuilt-only
)
[
-z
"
$x
"
]
[
-z
"
$x
"
]
nix-store
--option
binary-caches
"file://
$cacheDir
"
-r
$outPath
nix-store
--option
binary-caches
"file://
$cacheDir
"
--option
signed-binary-caches
''
-r
$outPath
nix-store
--check-validity
$outPath
nix-store
--check-validity
$outPath
nix-store
-qR
$outPath
|
grep
input-2
nix-store
-qR
$outPath
|
grep
input-2
...
@@ -63,7 +63,7 @@ mv $nar $nar.good
...
@@ -63,7 +63,7 @@ mv $nar $nar.good
mkdir
-p
$TEST_ROOT
/empty
mkdir
-p
$TEST_ROOT
/empty
nix-store
--dump
$TEST_ROOT
/empty | xz
>
$nar
nix-store
--dump
$TEST_ROOT
/empty | xz
>
$nar
nix-build
--option
binary-caches
"file://
$cacheDir
"
dependencies.nix
-o
$TEST_ROOT
/result 2>&1 |
tee
$TEST_ROOT
/log
nix-build
--option
binary-caches
"file://
$cacheDir
"
--option
signed-binary-caches
''
dependencies.nix
-o
$TEST_ROOT
/result 2>&1 |
tee
$TEST_ROOT
/log
grep
-q
"hash mismatch"
$TEST_ROOT
/log
grep
-q
"hash mismatch"
$TEST_ROOT
/log
mv
$nar
.good
$nar
mv
$nar
.good
$nar
...
@@ -73,7 +73,7 @@ mv $nar.good $nar
...
@@ -73,7 +73,7 @@ mv $nar.good $nar
clearStore
clearStore
clearCacheCache
clearCacheCache
if
nix-store
--option
binary-caches
"file://
$cacheDir
"
--option
signed-binary-caches
'*'
-r
$outPath
;
then
if
nix-store
--option
binary-caches
"file://
$cacheDir
"
-r
$outPath
;
then
echo
"unsigned binary cache incorrectly accepted"
echo
"unsigned binary cache incorrectly accepted"
exit
1
exit
1
fi
fi
...
@@ -99,7 +99,7 @@ clearStore
...
@@ -99,7 +99,7 @@ clearStore
rm
$(
grep
-l
"StorePath:.*dependencies-input-2"
$cacheDir
/
*
.narinfo
)
rm
$(
grep
-l
"StorePath:.*dependencies-input-2"
$cacheDir
/
*
.narinfo
)
nix-build
--option
binary-caches
"file://
$cacheDir
"
dependencies.nix
-o
$TEST_ROOT
/result 2>&1 |
tee
$TEST_ROOT
/log
nix-build
--option
binary-caches
"file://
$cacheDir
"
--option
signed-binary-caches
''
dependencies.nix
-o
$TEST_ROOT
/result 2>&1 |
tee
$TEST_ROOT
/log
grep
-q
"fetching path"
$TEST_ROOT
/log
grep
-q
"fetching path"
$TEST_ROOT
/log
...
...
This diff is collapsed.
Click to expand it.
tests/repair.sh
+
2
−
2
View file @
aa23bba2
...
@@ -51,7 +51,7 @@ nix copy --recursive --to file://$cacheDir $path
...
@@ -51,7 +51,7 @@ nix copy --recursive --to file://$cacheDir $path
chmod
u+w
$path2
chmod
u+w
$path2
rm
-rf
$path2
rm
-rf
$path2
nix-store
--verify
--check-contents
--repair
--option
binary-caches
"file://
$cacheDir
"
nix-store
--verify
--check-contents
--repair
--option
binary-caches
"file://
$cacheDir
"
--option
signed-binary-caches
''
if
[
"
$(
nix-hash
$path2
)
"
!=
"
$hash
"
-o
-e
$path2
/bad
]
;
then
if
[
"
$(
nix-hash
$path2
)
"
!=
"
$hash
"
-o
-e
$path2
/bad
]
;
then
echo
"path not repaired properly"
>
&2
echo
"path not repaired properly"
>
&2
...
@@ -69,7 +69,7 @@ if nix-store --verify-path $path2; then
...
@@ -69,7 +69,7 @@ if nix-store --verify-path $path2; then
exit
1
exit
1
fi
fi
nix-store
--repair-path
$path2
--option
binary-caches
"file://
$cacheDir
"
nix-store
--repair-path
$path2
--option
binary-caches
"file://
$cacheDir
"
--option
signed-binary-caches
''
if
[
"
$(
nix-hash
$path2
)
"
!=
"
$hash
"
-o
-e
$path2
/bad
]
;
then
if
[
"
$(
nix-hash
$path2
)
"
!=
"
$hash
"
-o
-e
$path2
/bad
]
;
then
echo
"path not repaired properly"
>
&2
echo
"path not repaired properly"
>
&2
...
...
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