blob: 011c07090308abb044c4eefc6fa550f94b365e03 [file] [log] [blame]
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.apache.kerby.kerberos.kdc;
import java.io.File;
import org.junit.Before;
/**
* This is an interop test using the Java GSS APIs against the Kerby KDC (using UDP)
*/
public class GssUdpInteropTest extends GssInteropTestBase {
@Before
@Override
public void setUp() throws Exception {
super.setUp();
File file1 = new File(this.getClass().getResource("/kerberos.jaas").getPath());
String content1 = getFileContent(file1.getPath());
String path1 = writeToTestDir(content1, file1.getName());
// System.setProperty("sun.security.krb5.debug", "true");
System.setProperty("java.security.auth.login.config", path1);
// Read in krb5.conf and substitute in the correct port
File file2 = new File(this.getClass().getResource("/krb5-udp.conf").getPath());
String content2 = getFileContent(file2.getPath());
content2 = content2.replaceAll("port", "" + udpPort);
String path2 = writeToTestDir(content2, file2.getName());
System.setProperty("java.security.krb5.conf", path2);
}
@Override
protected boolean allowUdp() {
return true;
}
}