mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-15 21:12:15 +00:00
[JENKINS-18368] added isUnix override to launcher decorator classes so that isUnix is maintained for remote launcherswq
This commit is contained in:
1 parent
1e7b82aea0
commit
656738c020
2 files changed
+33
No files matched your search
@@ -24,6 +24,7 @@
|
||||
|
||||
package hudson;
|
||||
|
||||
import jenkins.model.Jenkins;
|
||||
import hudson.model.StreamBuildListener;
|
||||
import hudson.model.TaskListener;
|
||||
import hudson.util.ProcessTree;
|
||||
@@ -92,4 +93,26 @@ public class LauncherTest extends ChannelTestCase {
|
||||
assertTrue(log, log.contains("val1 val2"));
|
||||
}
|
||||
|
||||
public void testDecoratedByEnvMaintainsIsUnix() throws Exception {
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
TaskListener listener = new StreamBuildListener(output);
|
||||
Launcher remoteLauncher = new Launcher.RemoteLauncher(listener, Jenkins.MasterComputer.localChannel, false);
|
||||
Launcher decorated = remoteLauncher.decorateByEnv(new EnvVars());
|
||||
assertEquals("not unix before decoration, unix after", false, decorated.isUnix());
|
||||
remoteLauncher = new Launcher.RemoteLauncher(listener, Jenkins.MasterComputer.localChannel, true);
|
||||
decorated = remoteLauncher.decorateByEnv(new EnvVars());
|
||||
assertEquals("unix before decoration, not unix after", true, decorated.isUnix());
|
||||
}
|
||||
|
||||
public void testDecoratedByPrefixMaintainsIsUnix() throws Exception {
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
TaskListener listener = new StreamBuildListener(output);
|
||||
Launcher remoteLauncher = new Launcher.RemoteLauncher(listener, Jenkins.MasterComputer.localChannel, false);
|
||||
Launcher decorated = remoteLauncher.decorateByPrefix("test");
|
||||
assertEquals("not unix before decoration, unix after", false, decorated.isUnix());
|
||||
remoteLauncher = new Launcher.RemoteLauncher(listener, Jenkins.MasterComputer.localChannel, true);
|
||||
decorated = remoteLauncher.decorateByPrefix("test");
|
||||
assertEquals("unix before decoration, not unix after", true, decorated.isUnix());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user