testing: migrate pass-as-file.sh
Change-Id: I9c3a940ede9353e977e60e0650eaa5a64cc6fa5e
This commit is contained in:
@@ -103,7 +103,6 @@ functional_tests_scripts = [
|
||||
'selfref-gc.sh',
|
||||
'db-migration.sh',
|
||||
'bash-profile.sh',
|
||||
'pass-as-file.sh',
|
||||
'store-ping.sh',
|
||||
'flakes/show.sh',
|
||||
'path-from-hash-part.sh',
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
source common.sh
|
||||
|
||||
clearStore
|
||||
|
||||
outPath=$(nix-build --no-out-link -E "
|
||||
with import ./config.nix;
|
||||
|
||||
mkDerivation {
|
||||
name = \"pass-as-file\";
|
||||
passAsFile = [ \"foo\" ];
|
||||
foo = [ \"xyzzy\" ];
|
||||
builder = builtins.toFile \"builder.sh\" ''
|
||||
[ \"\$(basename \$fooPath)\" = .attr-1bp7cri8hplaz6hbz0v4f0nl44rl84q1sg25kgwqzipzd1mv89ic ]
|
||||
[ \"\$(cat \$fooPath)\" = xyzzy ]
|
||||
touch \$out
|
||||
'';
|
||||
}
|
||||
")
|
||||
@@ -0,0 +1,26 @@
|
||||
from testlib.fixtures.nix import Nix
|
||||
from testlib.utils import get_global_asset
|
||||
from testlib.fixtures.file_helper import File, with_files
|
||||
|
||||
|
||||
@with_files(
|
||||
{
|
||||
"config.nix": get_global_asset("config.nix"),
|
||||
"default.nix": File("""
|
||||
with import ./config.nix;
|
||||
|
||||
mkDerivation {
|
||||
name = "pass-as-file";
|
||||
passAsFile = [ "foo" ];
|
||||
foo = [ "xyzzy" ];
|
||||
builder = builtins.toFile "builder.sh" ''
|
||||
[ "$(basename $fooPath)" = .attr-1bp7cri8hplaz6hbz0v4f0nl44rl84q1sg25kgwqzipzd1mv89ic ]
|
||||
[ "$(cat $fooPath)" = xyzzy ]
|
||||
touch $out
|
||||
'';
|
||||
}
|
||||
"""),
|
||||
}
|
||||
)
|
||||
def test_pass_as_file(nix: Nix):
|
||||
nix.nix_build([]).run().ok()
|
||||
Reference in New Issue
Block a user