Skip to content

Commit c3cfd16

Browse files
author
Vincent Partington
committed
Extracted usernames and passwords for Unix integration tests to UnixCloudHostListener
- Renamed contants for usernames and passwords for Windows integration tests.
1 parent f5587cd commit c3cfd16

19 files changed

+213
-245
lines changed
Lines changed: 86 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,113 @@
11
/**
22
* Copyright (c) 2008-2015, XebiaLabs B.V., All rights reserved.
3-
*
4-
*
3+
* <p/>
4+
* <p/>
55
* Overthere is licensed under the terms of the GPLv2
66
* <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most XebiaLabs Libraries.
77
* There are special exceptions to the terms and conditions of the GPLv2 as it is applied to
88
* this software, see the FLOSS License Exception
99
* <http://github.com/xebialabs/overthere/blob/master/LICENSE>.
10-
*
10+
* <p/>
1111
* This program is free software; you can redistribute it and/or modify it under the terms
1212
* of the GNU General Public License as published by the Free Software Foundation; version 2
1313
* of the License.
14-
*
14+
* <p/>
1515
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
1616
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1717
* See the GNU General Public License for more details.
18-
*
18+
* <p/>
1919
* You should have received a copy of the GNU General Public License along with this
2020
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth
2121
* Floor, Boston, MA 02110-1301 USA
2222
*/
2323
package com.xebialabs.overthere;
2424

25-
import java.util.concurrent.atomic.AtomicReference;
26-
2725
import com.xebialabs.overcast.host.CloudHost;
2826

27+
import java.util.concurrent.atomic.AtomicReference;
28+
2929
import static com.xebialabs.overthere.util.OverthereUtils.checkNotNull;
3030

3131
public class UnixCloudHostListener extends CloudHostListener {
3232

33+
public static final String REGULAR_UNIX_USER_USERNAME = "overthere";
34+
public static final String REGULAR_UNIX_USER_PASSWORD = "}Kp39hdb}LzM";
35+
public static final String REGULAR_UNIX_USER_PRIVATE_KEY =
36+
"-----BEGIN RSA PRIVATE KEY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Hgy0sr1yjeGqt8H2WQZOjW4wfpKs5TVhfjMoL4Znw6uSV7UHqsDw3K5lnI/3jV+SwiPry4DlMQ+wNoNCTZUBxhRWWK6AwFrkOGfH7JwTgzUvwxgoxi67jP+G5sCiAux2NHnkQCX4wq8O5bygHS5FgTVAPqKrkGBPZVDBGhi2VmEsFeUZQEFhe8Vb3ywk2O6hLWANmevpfTSdS/7tgcoxV13HJuC/KvdWnsCw+/CCV6QIY0+u23zcHL3uQi9Ytl4s5jQBfuO4L5L/TQm1U9X8a4Tx8WAtnUh7o2MwYFGgarw0mGN11M7sn
68+
// overthere@overthere-unix
69+
public static final String REGULAR_UNIX_USER_PASSPHRASE = "letmein";
70+
71+
public static final String ROOT_UNIX_USER_USERNAME = "root";
72+
public static final String ROOT_UNIX_USER_PASSWORD = "87bC=vu@DTHx";
73+
74+
public static final String UNTRUSTED_UNIX_USER_USERNAME = "untrusted";
75+
public static final String UNTRUSTED_UNIX_USER_PASSWORD = "\"zePVB,%EU84i\"";
76+
77+
public static final String TRUSTED_UNIX_USER_USERNAME = "trusted";
78+
public static final String TRUSTED_UNIX_USER_PRIVATE_KEY =
79+
"-----BEGIN RSA PRIVATE KEY-----\r\n"
80+
+ "MIIEpgIBAAKCAQEA65Jf19SCv8rZ/kLyfOw+OjHt5fQnxHVQR2B6UW0B0q6RhSSg\r\n"
81+
+ "YA2gOUEPJph7+O5605jjrMlblScsXO7VnFJtBTMRFoQjBlOP8VFuEg0MoaN5RPQU\r\n"
82+
+ "ZVYoFKP9V6ycEKpmfeSmVhpEipUdgL+fUjb1nsw+Cpx8WNLXf3Cvqrk4d1xZ0f0i\r\n"
83+
+ "u3D4/B+LmyZuVqvlmRfVDOe0Orvo/hfkiM+hMqKnFfKnUldvUb6feq4HrxpeYoEm\r\n"
84+
+ "sO+oqkNfVp/RfXiuSzBHQl6sYYwWDSHgsyIo/7o2ATcDw3FzErxR3pMjH0rqh39A\r\n"
85+
+ "TJtFTzvV90VNTRd+1727hzS6IQLf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AuO2znrxPUPtEuSus3K3Nj4m9\r\n"
100+
+ "KZDDbGroO79W0TMIqrxfYnffREhC05pp3ZBYiqVTJQ/CutTMbSxB5VzMSY55+I51\r\n"
101+
+ "i96U0OuJQ83rVXat6g/fm6uOQ3tqxULCnsjIvgNPUBNwoyWXYHvOJkeGVtCmFBFB\r\n"
102+
+ "YcF4rQb3AoGBAJ7Ekj7G0qDD+gJQ3JnWfWJNHHDU1LclntuZlzrLhKEAku9y7Q5I\r\n"
103+
+ "tygMnR1DYrWKTZPDtrCb1NJqPntPp8A4VMnkZ89AY11CexWrtDx9VDy4MJFr8uCx\r\n"
104+
+ "c05G9exoAKHonnFcWxOg+xIgofdfic3/vTg/aGPp1I2urqLzv00vPyeX\r\n"
105+
+ "-----END RSA PRIVATE KEY-----\r\n";
106+
// Corresponding public key:
107+
// ssh-rsa
108+
// AAAAB3NzaC1yc2EAAAADAQABAAABAQDrkl/X1IK/ytn+QvJ87D46Me3l9CfEdVBHYHpRbQHSrpGFJKBgDaA5QQ8mmHv47nrTmOOsyVuVJyxc7tWcUm0FMxEWhCMGU4/xUW4SDQyho3lE9BRlVigUo/1XrJwQqmZ95KZWGkSKlR2Av59SNvWezD4KnHxY0td/cK+quTh3XFnR/SK7cPj8H4ubJm5Wq+WZF9UM57Q6u+j+F+SIz6EyoqcV8qdSV29Rvp96rgevGl5igSaw76iqQ19Wn9F9eK5LMEdCXqxhjBYNIeCzIij/ujYBNwPDcXMSvFHekyMfSuqHf0BMm0VPO9X3RU1NF37XvbuHNLohAt/4z9jo6/Nr
109+
// overthere@overthere-unix
110+
33111
private static AtomicReference<CloudHost> unixHost = new AtomicReference<CloudHost>();
34112

35113
public UnixCloudHostListener() {
@@ -39,4 +117,5 @@ public UnixCloudHostListener() {
39117
public static CloudHost getHost() {
40118
return checkNotNull(unixHost.get(), "Cloud host overthere-unix has not been started. Did you wire up the right CloudHostListener?");
41119
}
120+
42121
}

src/test/java/com/xebialabs/overthere/WindowsCloudHostListener.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@
3030

3131
public class WindowsCloudHostListener extends CloudHostListener {
3232

33-
public static final String ADMINISTRATIVE_USER_ITEST_USERNAME = "Administrator";
34-
public static final String ADMINISTRATIVE_USER_ITEST_PASSWORD = "iW8tcaM0d";
35-
public static final String REGULAR_USER_ITEST_USERNAME = "overthere";
33+
public static final String REGULAR_WINDOWS_USER_USERNAME = "overthere";
34+
public static final String REGULAR_WINDOWS_USER_PASSWORD = "wLitdMy@:;<>KY9";
3635
// The password for the regular user includes special characters to test that they get encoded correctly
37-
public static final String REGULAR_USER_ITEST_PASSWORD = "wLitdMy@:;<>KY9";
36+
37+
public static final String ADMINISTRATIVE_WINDOWS_USER_USERNAME = "Administrator";
38+
public static final String ADMINISTRATIVE_WINDOWS_USER_PASSWORD = "iW8tcaM0d";
39+
3840
private static AtomicReference<CloudHost> windowsHost = new AtomicReference<CloudHost>();
3941

4042
public WindowsCloudHostListener() {

src/test/java/com/xebialabs/overthere/cifs/telnet/CifsTelnetConnectionWithAdministrativeUserItest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
import static com.xebialabs.overthere.ConnectionOptions.PASSWORD;
3535
import static com.xebialabs.overthere.ConnectionOptions.USERNAME;
3636
import static com.xebialabs.overthere.OperatingSystemFamily.WINDOWS;
37-
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_USER_ITEST_PASSWORD;
38-
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_USER_ITEST_USERNAME;
37+
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_WINDOWS_USER_PASSWORD;
38+
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_WINDOWS_USER_USERNAME;
3939
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.CIFS_PROTOCOL;
4040
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.CONNECTION_TYPE;
4141
import static com.xebialabs.overthere.cifs.CifsConnectionType.TELNET;
@@ -55,8 +55,8 @@ protected ConnectionOptions getOptions() {
5555
options.set(OPERATING_SYSTEM, WINDOWS);
5656
options.set(CONNECTION_TYPE, TELNET);
5757
options.set(ADDRESS, WindowsCloudHostListener.getHost().getHostName());
58-
options.set(USERNAME, ADMINISTRATIVE_USER_ITEST_USERNAME);
59-
options.set(PASSWORD, ADMINISTRATIVE_USER_ITEST_PASSWORD);
58+
options.set(USERNAME, ADMINISTRATIVE_WINDOWS_USER_USERNAME);
59+
options.set(PASSWORD, ADMINISTRATIVE_WINDOWS_USER_PASSWORD);
6060
return options;
6161
}
6262

src/test/java/com/xebialabs/overthere/cifs/telnet/CifsTelnetConnectionWithRegularUserItest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
import static com.xebialabs.overthere.ConnectionOptions.TEMPORARY_DIRECTORY_PATH;
3737
import static com.xebialabs.overthere.ConnectionOptions.USERNAME;
3838
import static com.xebialabs.overthere.OperatingSystemFamily.WINDOWS;
39-
import static com.xebialabs.overthere.WindowsCloudHostListener.REGULAR_USER_ITEST_PASSWORD;
40-
import static com.xebialabs.overthere.WindowsCloudHostListener.REGULAR_USER_ITEST_USERNAME;
39+
import static com.xebialabs.overthere.WindowsCloudHostListener.REGULAR_WINDOWS_USER_PASSWORD;
40+
import static com.xebialabs.overthere.WindowsCloudHostListener.REGULAR_WINDOWS_USER_USERNAME;
4141
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.CIFS_PROTOCOL;
4242
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.CONNECTION_TYPE;
4343
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.PATH_SHARE_MAPPINGS;
@@ -58,8 +58,8 @@ protected ConnectionOptions getOptions() {
5858
options.set(OPERATING_SYSTEM, WINDOWS);
5959
options.set(CONNECTION_TYPE, TELNET);
6060
options.set(ADDRESS, WindowsCloudHostListener.getHost().getHostName());
61-
options.set(USERNAME, REGULAR_USER_ITEST_USERNAME);
62-
options.set(PASSWORD, REGULAR_USER_ITEST_PASSWORD);
61+
options.set(USERNAME, REGULAR_WINDOWS_USER_USERNAME);
62+
options.set(PASSWORD, REGULAR_WINDOWS_USER_PASSWORD);
6363
options.set(TEMPORARY_DIRECTORY_PATH, "C:\\overthere\\temp");
6464
options.set(PATH_SHARE_MAPPINGS, ImmutableMap.of("C:\\overthere", "sharethere"));
6565
return options;

src/test/java/com/xebialabs/overthere/cifs/winrm/CifsWinRmConnectionOverHttpWithAdministrativeUserItest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
import static com.xebialabs.overthere.ConnectionOptions.PASSWORD;
3535
import static com.xebialabs.overthere.ConnectionOptions.USERNAME;
3636
import static com.xebialabs.overthere.OperatingSystemFamily.WINDOWS;
37-
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_USER_ITEST_PASSWORD;
38-
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_USER_ITEST_USERNAME;
37+
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_WINDOWS_USER_PASSWORD;
38+
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_WINDOWS_USER_USERNAME;
3939
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.CIFS_PROTOCOL;
4040
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.CONNECTION_TYPE;
4141
import static com.xebialabs.overthere.cifs.CifsConnectionType.WINRM_INTERNAL;
@@ -55,8 +55,8 @@ protected ConnectionOptions getOptions() {
5555
options.set(OPERATING_SYSTEM, WINDOWS);
5656
options.set(CONNECTION_TYPE, WINRM_INTERNAL);
5757
options.set(ADDRESS, WindowsCloudHostListener.getHost().getHostName());
58-
options.set(USERNAME, ADMINISTRATIVE_USER_ITEST_USERNAME);
59-
options.set(PASSWORD, ADMINISTRATIVE_USER_ITEST_PASSWORD);
58+
options.set(USERNAME, ADMINISTRATIVE_WINDOWS_USER_USERNAME);
59+
options.set(PASSWORD, ADMINISTRATIVE_WINDOWS_USER_PASSWORD);
6060
return options;
6161
}
6262

src/test/java/com/xebialabs/overthere/cifs/winrm/CifsWinRmConnectionOverHttpsWithAdministrativeUserItest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
import static com.xebialabs.overthere.ConnectionOptions.PASSWORD;
3737
import static com.xebialabs.overthere.ConnectionOptions.USERNAME;
3838
import static com.xebialabs.overthere.OperatingSystemFamily.WINDOWS;
39-
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_USER_ITEST_PASSWORD;
40-
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_USER_ITEST_USERNAME;
39+
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_WINDOWS_USER_PASSWORD;
40+
import static com.xebialabs.overthere.WindowsCloudHostListener.ADMINISTRATIVE_WINDOWS_USER_USERNAME;
4141
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.CIFS_PROTOCOL;
4242
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.CONNECTION_TYPE;
4343
import static com.xebialabs.overthere.cifs.CifsConnectionBuilder.WINRM_ENABLE_HTTPS;
@@ -60,8 +60,8 @@ protected ConnectionOptions getOptions() {
6060
options.set(OPERATING_SYSTEM, WINDOWS);
6161
options.set(CONNECTION_TYPE, WINRM_INTERNAL);
6262
options.set(ADDRESS, WindowsCloudHostListener.getHost().getHostName());
63-
options.set(USERNAME, ADMINISTRATIVE_USER_ITEST_USERNAME);
64-
options.set(PASSWORD, ADMINISTRATIVE_USER_ITEST_PASSWORD);
63+
options.set(USERNAME, ADMINISTRATIVE_WINDOWS_USER_USERNAME);
64+
options.set(PASSWORD, ADMINISTRATIVE_WINDOWS_USER_PASSWORD);
6565
options.set(WINRM_ENABLE_HTTPS, true);
6666
options.set(WINRM_HTTPS_CERTIFICATE_TRUST_STRATEGY, WinrmHttpsCertificateTrustStrategy.ALLOW_ALL);
6767
options.set(WINRM_HTTPS_HOSTNAME_VERIFICATION_STRATEGY, WinrmHttpsHostnameVerificationStrategy.ALLOW_ALL);

src/test/java/com/xebialabs/overthere/ssh/SshInteractiveSudoConnectionItest.java

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,23 @@
2222
*/
2323
package com.xebialabs.overthere.ssh;
2424

25-
import org.testng.annotations.Listeners;
26-
import org.testng.annotations.Test;
27-
2825
import com.xebialabs.overthere.ConnectionOptions;
29-
import com.xebialabs.overthere.itest.OverthereConnectionItestBase;
3026
import com.xebialabs.overthere.UnixCloudHostListener;
27+
import com.xebialabs.overthere.itest.OverthereConnectionItestBase;
28+
import org.testng.annotations.Listeners;
29+
import org.testng.annotations.Test;
3130

32-
import static com.xebialabs.overthere.ConnectionOptions.ADDRESS;
33-
import static com.xebialabs.overthere.ConnectionOptions.OPERATING_SYSTEM;
34-
import static com.xebialabs.overthere.ConnectionOptions.PASSWORD;
35-
import static com.xebialabs.overthere.ConnectionOptions.PORT;
36-
import static com.xebialabs.overthere.ConnectionOptions.USERNAME;
31+
import static com.xebialabs.overthere.ConnectionOptions.*;
3732
import static com.xebialabs.overthere.OperatingSystemFamily.UNIX;
38-
import static com.xebialabs.overthere.ssh.SshConnectionBuilder.ALLOCATE_DEFAULT_PTY;
39-
import static com.xebialabs.overthere.ssh.SshConnectionBuilder.CONNECTION_TYPE;
40-
import static com.xebialabs.overthere.ssh.SshConnectionBuilder.SSH_PROTOCOL;
41-
import static com.xebialabs.overthere.ssh.SshConnectionBuilder.SUDO_OVERRIDE_UMASK;
42-
import static com.xebialabs.overthere.ssh.SshConnectionBuilder.SUDO_PASSWORD_PROMPT_REGEX;
43-
import static com.xebialabs.overthere.ssh.SshConnectionBuilder.SUDO_USERNAME;
33+
import static com.xebialabs.overthere.UnixCloudHostListener.*;
34+
import static com.xebialabs.overthere.ssh.SshConnectionBuilder.*;
4435
import static com.xebialabs.overthere.ssh.SshConnectionType.INTERACTIVE_SUDO;
4536

4637
@Test
4738
@Listeners({UnixCloudHostListener.class})
4839
public class SshInteractiveSudoConnectionItest extends OverthereConnectionItestBase {
4940

41+
5042
@Override
5143
protected String getProtocol() {
5244
return SSH_PROTOCOL;
@@ -59,9 +51,9 @@ protected ConnectionOptions getOptions() {
5951
options.set(CONNECTION_TYPE, INTERACTIVE_SUDO);
6052
options.set(ADDRESS, UnixCloudHostListener.getHost().getHostName());
6153
options.set(PORT, 22);
62-
options.set(USERNAME, "untrusted");
63-
options.set(PASSWORD, "zePVB,%EU84i");
64-
options.set(SUDO_USERNAME, "overthere");
54+
options.set(USERNAME, UNTRUSTED_UNIX_USER_USERNAME);
55+
options.set(PASSWORD, UNTRUSTED_UNIX_USER_PASSWORD);
56+
options.set(SUDO_USERNAME, REGULAR_UNIX_USER_USERNAME);
6557
options.set(SUDO_PASSWORD_PROMPT_REGEX, ".*[P|p]assword.*:");
6658
options.set(ALLOCATE_DEFAULT_PTY, true);
6759
options.set(SUDO_OVERRIDE_UMASK, true);

0 commit comments

Comments
 (0)