-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trivially factored out WriteSysconfig, WriteCurlrc
- Loading branch information
Showing
4 changed files
with
182 additions
and
26 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
Empty file.
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,75 @@ | ||
Read .target.tmpdir "/tmp" | ||
Dump Write: disabled | ||
Write .sysconfig.proxy.PROXY_ENABLED "no" true | ||
Write .sysconfig.proxy.HTTP_PROXY "" true | ||
Write .sysconfig.proxy.HTTPS_PROXY "" true | ||
Write .sysconfig.proxy.FTP_PROXY "" true | ||
Write .sysconfig.proxy.NO_PROXY "localhost" true | ||
Write .sysconfig.proxy nil true | ||
Write .root.curlrc."--proxy-user" nil true | ||
Write .root.curlrc."--proxy" nil true | ||
Write .root.curlrc nil true | ||
Return true | ||
Dump Write: enabled | ||
Write .sysconfig.proxy.PROXY_ENABLED "yes" true | ||
Write .sysconfig.proxy.HTTP_PROXY "proxy.example.org:3128" true | ||
Write .sysconfig.proxy.HTTPS_PROXY "" true | ||
Write .sysconfig.proxy.FTP_PROXY "" true | ||
Write .sysconfig.proxy.NO_PROXY "localhost" true | ||
Write .sysconfig.proxy nil true | ||
Write .root.curlrc."--proxy-user" nil true | ||
Write .root.curlrc."--proxy" "proxy.example.org:3128" true | ||
Execute .target.bash_output "/bin/date '+%x'" $["stdout":"2015-01-31\n"] | ||
Write .root.curlrc."--proxy"."comment" "\n# Changed by YaST2 module proxy 2015-01-31\n" true | ||
Write .root.curlrc nil true | ||
Return true | ||
Dump Write: authenticated | ||
Write .sysconfig.proxy.PROXY_ENABLED "yes" true | ||
Write .sysconfig.proxy.HTTP_PROXY "proxy.example.org:3128" true | ||
Write .sysconfig.proxy.HTTPS_PROXY "" true | ||
Write .sysconfig.proxy.FTP_PROXY "" true | ||
Write .sysconfig.proxy.NO_PROXY "localhost" true | ||
Write .sysconfig.proxy nil true | ||
Write .root.curlrc."--proxy-user" "User\\\\Domain:P" true | ||
Write .root.curlrc."--proxy" "proxy.example.org:3128" true | ||
Execute .target.bash_output "/bin/date '+%x'" $["stdout":"2015-01-31\n"] | ||
Write .root.curlrc."--proxy-user"."comment" "\n# Changed by YaST2 module proxy 2015-01-31\n" true | ||
Write .root.curlrc nil true | ||
Return true | ||
Dump Write: ftp | ||
Write .sysconfig.proxy.PROXY_ENABLED "yes" true | ||
Write .sysconfig.proxy.HTTP_PROXY "" true | ||
Write .sysconfig.proxy.HTTPS_PROXY "" true | ||
Write .sysconfig.proxy.FTP_PROXY "proxy.example.org:3128" true | ||
Write .sysconfig.proxy.NO_PROXY "localhost" true | ||
Write .sysconfig.proxy nil true | ||
Write .root.curlrc."--proxy-user" nil true | ||
Write .root.curlrc."--proxy" nil true | ||
Write .root.curlrc nil true | ||
Return true | ||
Dump Write: authenticated ftp | ||
Write .sysconfig.proxy.PROXY_ENABLED "yes" true | ||
Write .sysconfig.proxy.HTTP_PROXY "" true | ||
Write .sysconfig.proxy.HTTPS_PROXY "" true | ||
Write .sysconfig.proxy.FTP_PROXY "proxy.example.org:3128" true | ||
Write .sysconfig.proxy.NO_PROXY "localhost" true | ||
Write .sysconfig.proxy nil true | ||
Write .root.curlrc."--proxy-user" "U:P" true | ||
Write .root.curlrc."--proxy" nil true | ||
Execute .target.bash_output "/bin/date '+%x'" $["stdout":"2015-01-31\n"] | ||
Write .root.curlrc."--proxy-user"."comment" "\n# Changed by YaST2 module proxy 2015-01-31\n" true | ||
Write .root.curlrc nil true | ||
Return true | ||
Dump Write: full | ||
Write .sysconfig.proxy.PROXY_ENABLED "yes" true | ||
Write .sysconfig.proxy.HTTP_PROXY "proxy1.example.org:3128" true | ||
Write .sysconfig.proxy.HTTPS_PROXY "proxy2.example.org:3128" true | ||
Write .sysconfig.proxy.FTP_PROXY "proxy3.example.org:3128" true | ||
Write .sysconfig.proxy.NO_PROXY "example.org,example.com,localhost" true | ||
Write .sysconfig.proxy nil true | ||
Write .root.curlrc."--proxy-user" "U:P" true | ||
Write .root.curlrc."--proxy" "proxy1.example.org:3128" true | ||
Execute .target.bash_output "/bin/date '+%x'" $["stdout":"2015-01-31\n"] | ||
Write .root.curlrc."--proxy-user"."comment" "\n# Changed by YaST2 module proxy 2015-01-31\n" true | ||
Write .root.curlrc nil true | ||
Return true |
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,73 @@ | ||
{ | ||
include "testsuite.ycp"; | ||
|
||
map READ = $[ | ||
"target" : $[ | ||
"tmpdir" : "/tmp", | ||
], | ||
]; | ||
|
||
map EXEC = $[ | ||
"target": $[ | ||
"bash_output": $[ | ||
"stdout": "2015-01-31\n" | ||
] | ||
] | ||
]; | ||
|
||
list<map> stubs = [READ, $[], EXEC]; | ||
TESTSUITE_INIT(stubs, nil); | ||
|
||
import "Proxy"; | ||
import "Progress"; | ||
Progress::off(); | ||
|
||
DUMP("Write: disabled"); | ||
Proxy::Import($["enabled": false]); | ||
TEST(``(Proxy::Write()), stubs, nil); | ||
|
||
DUMP("Write: enabled"); | ||
Proxy::Import($[ | ||
"enabled": true, | ||
"http_proxy": "proxy.example.org:3128", | ||
]); | ||
TEST(``(Proxy::Write()), stubs, nil); | ||
|
||
DUMP("Write: authenticated"); | ||
Proxy::Import($[ | ||
"enabled": true, | ||
"http_proxy": "proxy.example.org:3128", | ||
"proxy_user": "User\\Domain", | ||
"proxy_password": "P", | ||
]); | ||
TEST(``(Proxy::Write()), stubs, nil); | ||
|
||
DUMP("Write: ftp"); | ||
Proxy::Import($[ | ||
"enabled": true, | ||
"ftp_proxy": "proxy.example.org:3128", | ||
]); | ||
TEST(``(Proxy::Write()), stubs, nil); | ||
|
||
DUMP("Write: authenticated ftp"); | ||
Proxy::Import($[ | ||
"enabled": true, | ||
"ftp_proxy": "proxy.example.org:3128", | ||
"proxy_user": "U", | ||
"proxy_password": "P", | ||
]); | ||
TEST(``(Proxy::Write()), stubs, nil); | ||
|
||
DUMP("Write: full"); | ||
Proxy::Import($[ | ||
"enabled": true, | ||
"http_proxy": "proxy1.example.org:3128", | ||
"https_proxy": "proxy2.example.org:3128", | ||
"ftp_proxy": "proxy3.example.org:3128", | ||
"no_proxy": "example.org,example.com,localhost", | ||
"proxy_user": "U", | ||
"proxy_password": "P", | ||
]); | ||
TEST(``(Proxy::Write()), stubs, nil); | ||
|
||
} |