| 
									
										
										
										
											2019-11-05 00:35:20 +01:00
										 |  |  | import ./make-test-python.nix ({ lib, ... }: with lib; | 
					
						
							| 
									
										
										
										
											2018-06-18 19:59:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | rec { | 
					
						
							|  |  |  |   name = "tor"; | 
					
						
							|  |  |  |   meta.maintainers = with maintainers; [ joachifm ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   common = | 
					
						
							| 
									
										
										
										
											2018-07-20 20:56:59 +00:00
										 |  |  |     { ... }: | 
					
						
							| 
									
										
										
										
											2018-06-18 19:59:19 +02:00
										 |  |  |     { boot.kernelParams = [ "audit=0" "apparmor=0" "quiet" ]; | 
					
						
							|  |  |  |       networking.firewall.enable = false; | 
					
						
							|  |  |  |       networking.useDHCP = false; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   nodes.client = | 
					
						
							| 
									
										
										
										
											2018-07-20 20:56:59 +00:00
										 |  |  |     { pkgs, ... }: | 
					
						
							| 
									
										
										
										
											2018-06-18 19:59:19 +02:00
										 |  |  |     { imports = [ common ]; | 
					
						
							|  |  |  |       environment.systemPackages = with pkgs; [ netcat ]; | 
					
						
							|  |  |  |       services.tor.enable = true; | 
					
						
							|  |  |  |       services.tor.client.enable = true; | 
					
						
							| 
									
										
										
										
											2020-09-11 07:46:59 +02:00
										 |  |  |       services.tor.settings.ControlPort = 9051; | 
					
						
							| 
									
										
										
										
											2018-06-18 19:59:19 +02:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   testScript = ''
 | 
					
						
							| 
									
										
										
										
											2019-11-05 00:35:20 +01:00
										 |  |  |     client.wait_for_unit("tor.service") | 
					
						
							|  |  |  |     client.wait_for_open_port(9051) | 
					
						
							|  |  |  |     assert "514 Authentication required." in client.succeed( | 
					
						
							|  |  |  |         "echo GETINFO version | nc 127.0.0.1 9051" | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2018-06-18 19:59:19 +02:00
										 |  |  |   '';
 | 
					
						
							|  |  |  | }) |