From fccbc53357d7387724f4468c9260b1942811b686 Mon Sep 17 00:00:00 2001 From: Robert Joseph Evans Date: Mon, 16 Apr 2012 16:08:44 +0000 Subject: [PATCH] HADOOP-8283. Allow tests to control token service value (Daryn Sharp via bobby) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1326668 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop-common/CHANGES.txt | 3 ++ .../security/SecurityUtilTestHelper.java | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/SecurityUtilTestHelper.java diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 57bc9e0fb9..88ea20d4f3 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -435,6 +435,9 @@ Release 0.23.3 - UNRELEASED HADOOP-7510. Tokens should use original hostname provided instead of ip (Daryn Sharp via bobby) + HADOOP-8283. Allow tests to control token service value (Daryn Sharp via + bobby) + Release 0.23.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/SecurityUtilTestHelper.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/SecurityUtilTestHelper.java new file mode 100644 index 0000000000..7c5f5e1e14 --- /dev/null +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/SecurityUtilTestHelper.java @@ -0,0 +1,30 @@ +/** + * 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.hadoop.security; + +/** helper utils for tests */ +public class SecurityUtilTestHelper { + + /** + * Allow tests to change the resolver used for tokens + * @param flag boolean for whether token services use ips or hosts + */ + public static void setTokenServiceUseIp(boolean flag) { + SecurityUtil.setTokenServiceUseIp(flag); + } +}