-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a dedicated networking.proxy option
Following the discussion #5021: - obsolete the nix.proxy option - add the networking.proxy option - open a default no_proxy environment variable - add a rsync option - Manual tests ok. - Automatic tests ok.
- Loading branch information
Showing
4 changed files
with
81 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Test whether `networking.proxy' work as expected. | ||
|
||
import ./make-test.nix { | ||
name = "networking-proxy"; | ||
|
||
nodes = { | ||
machine = | ||
{ config, pkgs, ... }: | ||
|
||
{ | ||
imports = [ ./common/user-account.nix ]; | ||
|
||
networking.proxy = "http://user:pass@host:port"; | ||
services.xserver.enable = false; | ||
|
||
virtualisation.memorySize = 128; | ||
}; | ||
|
||
machine2 = | ||
{ config, pkgs, ... }: | ||
|
||
{ | ||
imports = [ ./common/user-account.nix ]; | ||
|
||
services.xserver.enable = false; | ||
|
||
virtualisation.memorySize = 128; | ||
}; | ||
}; | ||
|
||
testScript = | ||
'' | ||
startAll; | ||
$machine->sleep(10); | ||
print $machine->execute("env | grep -i proxy"); | ||
print $machine->execute("su - alice -c 'env | grep -i proxy'"); | ||
$machine->mustSucceed("env | grep -i proxy"); | ||
$machine->mustSucceed("su - alice -c 'env | grep -i proxy'"); | ||
print $machine2->execute("env | grep -i proxy"); | ||
print $machine2->execute("su - alice -c 'env | grep -i proxy'"); | ||
$machine2->mustFail("env | grep -i proxy"); | ||
$machine2->mustFail("su - alice -c 'env | grep -i proxy'"); | ||
''; | ||
|
||
} |