 8dbd8f4d69
			
		
	
	
		8dbd8f4d69
		
	
	
	
	
		
			
			Test failed because of an incomplete apparmor profile. - fix apparmor profile - improve test timing, prevent non-deterministic failure
		
			
				
	
	
		
			34 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
| import ./make-test.nix ({ pkgs, ... }: {
 | |
|   name = "dnscrypt-proxy";
 | |
|   meta = with pkgs.stdenv.lib.maintainers; {
 | |
|     maintainers = [ joachifm ];
 | |
|   };
 | |
| 
 | |
|   nodes = {
 | |
|     # A client running the recommended setup: DNSCrypt proxy as a forwarder
 | |
|     # for a caching DNS client.
 | |
|     client =
 | |
|     { config, pkgs, ... }:
 | |
|     let localProxyPort = 43; in
 | |
|     {
 | |
|       security.apparmor.enable = true;
 | |
| 
 | |
|       services.dnscrypt-proxy.enable = true;
 | |
|       services.dnscrypt-proxy.localPort = localProxyPort;
 | |
|       services.dnscrypt-proxy.extraArgs = [ "-X libdcplugin_example.so" ];
 | |
| 
 | |
|       services.dnsmasq.enable = true;
 | |
|       services.dnsmasq.servers = [ "127.0.0.1#${toString localProxyPort}" ];
 | |
|     };
 | |
|   };
 | |
| 
 | |
|   testScript = ''
 | |
|     $client->waitForUnit("dnsmasq");
 | |
| 
 | |
|     # The daemon is socket activated; sending a single ping should activate it.
 | |
|     $client->fail("systemctl is-active dnscrypt-proxy");
 | |
|     $client->execute("${pkgs.iputils}/bin/ping -c1 example.com");
 | |
|     $client->waitUntilSucceeds("systemctl is-active dnscrypt-proxy");
 | |
|   '';
 | |
| })
 |