Author: sandervanderburg Date: Tue Jan 25 15:23:12 2011 New Revision: 25689 URL: https://svn.nixos.org/websvn/nix/?rev=25689&sc=1
Log: Add release.nix and a simple testcase Added: disnix/examples/disnix-proxy-example/trunk/extractservices.xsl disnix/examples/disnix-proxy-example/trunk/release.nix disnix/examples/disnix-proxy-example/trunk/version Added: disnix/examples/disnix-proxy-example/trunk/extractservices.xsl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ disnix/examples/disnix-proxy-example/trunk/extractservices.xsl Tue Jan 25 15:23:12 2011 (r25689) @@ -0,0 +1,10 @@ +<?xml version="1.0"?> + +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output omit-xml-declaration="yes" /> + <xsl:template match="/"> + <xsl:for-each select="manifest/activation/mapping"> + <xsl:value-of select="service" /><xsl:text>
</xsl:text> + </xsl:for-each> + </xsl:template> +</xsl:stylesheet> Added: disnix/examples/disnix-proxy-example/trunk/release.nix ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ disnix/examples/disnix-proxy-example/trunk/release.nix Tue Jan 25 15:23:12 2011 (r25689) @@ -0,0 +1,80 @@ +{ nixpkgs ? /etc/nixos/nixpkgs +, nixos ? /etc/nixos/nixos +}: + +let + + jobs = rec { + tarball = + { disnix_proxy_example ? {outPath = ./.; rev = 1234;} + , officialRelease ? false}: + + let + pkgs = import nixpkgs {}; + + disnixos = import "${pkgs.disnixos}/share/disnixos/testing.nix" { + inherit nixpkgs nixos; + }; + in + disnixos.sourceTarball { + name = "disnix-proxy-example"; + version = builtins.readFile ./version; + src = disnix_proxy_example; + inherit officialRelease; + }; + + build = + { tarball ? jobs.tarball {} + , system ? "x86_64-linux" + }: + + let + pkgs = import nixpkgs { inherit system; }; + + disnixos = import "${pkgs.disnixos}/share/disnixos/testing.nix" { + inherit nixpkgs nixos system; + }; + in + disnixos.buildManifest { + name = "disnix-proxy-example"; + version = builtins.readFile ./version; + inherit tarball; + servicesFile = "deployment/DistributedDeployment/services-without-proxy.nix"; + networkFile = "deployment/DistributedDeployment/network.nix"; + distributionFile = "deployment/DistributedDeployment/distribution-without-proxy.nix"; + }; + + tests = + + let + pkgs = import nixpkgs {}; + + disnixos = import "${pkgs.disnixos}/share/disnixos/testing.nix" { + inherit nixpkgs nixos; + }; + + manifest = build { system = "x86_64-linux"; }; + in + disnixos.disnixTest { + name = "disnix-proxy-example"; + tarball = tarball {}; + inherit manifest; + networkFile = "deployment/DistributedDeployment/network.nix"; + testScript = + '' + # Check whether a connection can be established between client and + # server. This test should succeed. + + my $hello_world_client = $test2->mustSucceed("${pkgs.libxslt}/bin/xsltproc ${./extractservices.xsl} ${manifest}/manifest.xml | grep hello-world-client"); + my $result = $test2->mustSucceed("(echo 'hello'; sleep 10) | ".substr($hello_world_client, 0, -1)."/bin/hello-world-client || exit 0"); + + if ($result =~ /Hello world/) { + print "Output contains: Hello world!\n"; + } else { + die "Output should contain: Hello world!\n"; + } + ''; + }; + }; +in +jobs Added: disnix/examples/disnix-proxy-example/trunk/version ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ disnix/examples/disnix-proxy-example/trunk/version Tue Jan 25 15:23:12 2011 (r25689) @@ -0,0 +1 @@ +0.1 \ No newline at end of file _______________________________________________ nix-commits mailing list [email protected] http://mail.cs.uu.nl/mailman/listinfo/nix-commits
