test/jdk/sun/security/krb5/auto/tools/KinitConfPlusProps.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 32837 jdk/test/sun/security/krb5/auto/tools/KinitConfPlusProps.java@e331a1a5a621
child 51675 b487c1e914d0
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32516
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     1
/*
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     4
 *
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     7
 * published by the Free Software Foundation.
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     8
 *
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    13
 * accompanied this code).
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    14
 *
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    18
 *
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    21
 * questions.
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    22
 */
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    23
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    24
import java.io.File;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    25
import java.util.HashMap;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    26
import java.util.Map;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    27
import jdk.testlibrary.ProcessTools;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    28
import jdk.testlibrary.OutputAnalyzer;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    29
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    30
/*
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    31
 * @test
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    32
 * @bug 6857795 8075299
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    33
 * @summary Checks if kinit uses both krb5 conf file and system properties
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    34
 * @requires os.family == "windows"
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    35
 * @library /lib/testlibrary
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    36
 * @library /sun/security/krb5/auto
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    37
 * @run main/othervm KinitConfPlusProps
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    38
 */
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    39
public class KinitConfPlusProps {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    40
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    41
    private static final String KINIT = System.getProperty("java.home")
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    42
            + File.separator + "bin" + File.separator + "kinit";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    43
    private static final String KLIST = System.getProperty("java.home")
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    44
            + File.separator + "bin" + File.separator + "klist";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    45
    private static final String REALM = "REALM";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    46
    private static final String ANOTHER_REALM = "ANOTHER.REALM";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    47
    private static final String HOST = "localhost";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    48
    private static final String CC_FILENAME = "krb5cc_test";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    49
    private static final String USER = "TESTER";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    50
    private static final String USER_PRINCIPAL = USER + "@" + REALM;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    51
    private static final String KRBTGT_PRINCIPAL = "krbtgt/" + REALM;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    52
    private static final String KEYTAB_FILE = "test.keytab";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    53
    private static final String KRB5_CONF_FILENAME = "krb5.conf";
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    54
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    55
    public static void main(String[] args) throws Exception {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    56
        // define principals
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    57
        Map<String, String> principals = new HashMap<>();
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    58
        principals.put(USER_PRINCIPAL, null);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    59
        principals.put(KRBTGT_PRINCIPAL, null);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    60
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    61
        System.setProperty("java.security.krb5.conf", KRB5_CONF_FILENAME);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    62
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    63
        // start a local KDC instance
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    64
        KDC kdc = KDC.startKDC(HOST, null, REALM, principals, KEYTAB_FILE,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    65
                KDC.KtabMode.APPEND);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    66
        KDC.saveConfig(KRB5_CONF_FILENAME, kdc,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    67
                "forwardable = true", "proxiable = true");
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    68
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    69
        boolean success = true;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    70
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    71
        /*
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    72
         * kinit should fail since java.security.krb5.kdc
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    73
         * and java.security.krb5.realm properties override correct values
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    74
         * in krb5 conf file
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    75
         */
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    76
        String[] command = {KINIT, "-k",
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    77
            "-J-Djava.security.krb5.realm=" + REALM,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    78
            "-J-Djava.security.krb5.kdc=" + HOST,   // without port
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    79
            "-J-Djava.security.krb5.conf=" + KRB5_CONF_FILENAME,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    80
            "-t", KEYTAB_FILE,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    81
            "-c", CC_FILENAME,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    82
            USER
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    83
        };
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    84
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    85
        try {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    86
            OutputAnalyzer out = ProcessTools.executeCommand(command);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    87
            out.shouldHaveExitValue(-1);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    88
        } catch(Throwable e) {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    89
            System.out.println("Unexpected exception: " + e);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    90
            e.printStackTrace(System.out);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    91
            success = false;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    92
        }
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    93
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    94
        /*
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    95
         * kinit should succeed
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    96
         * since realm should be picked up from principal name
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    97
         */
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    98
        command = new String[] {KINIT, "-k",
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
    99
            "-J-Djava.security.krb5.realm=" + ANOTHER_REALM,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   100
            "-J-Djava.security.krb5.kdc=" + HOST,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   101
            "-J-Djava.security.krb5.conf=" + KRB5_CONF_FILENAME,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   102
            "-t", KEYTAB_FILE,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   103
            "-c", CC_FILENAME,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   104
            USER_PRINCIPAL
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   105
        };
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   106
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   107
        try {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   108
            OutputAnalyzer out = ProcessTools.executeCommand(command);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   109
            out.shouldHaveExitValue(0);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   110
            out.shouldContain(CC_FILENAME);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   111
        } catch(Throwable e) {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   112
            System.out.println("Unexpected exception: " + e);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   113
            e.printStackTrace(System.out);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   114
            success = false;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   115
        }
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   116
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   117
        success &= checkTicketFlags();
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   118
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   119
        /*
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   120
         * kinit should succeed
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   121
         * since realm should be picked up from principal name,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   122
         * and other data should come from krb5 conf file
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   123
         */
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   124
        command = new String[] {KINIT, "-k",
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   125
            "-J-Djava.security.krb5.conf=" + KRB5_CONF_FILENAME,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   126
            "-t", KEYTAB_FILE,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   127
            "-c", CC_FILENAME,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   128
            USER_PRINCIPAL
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   129
        };
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   130
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   131
        try {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   132
            OutputAnalyzer out = ProcessTools.executeCommand(command);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   133
            out.shouldHaveExitValue(0);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   134
            out.shouldContain(CC_FILENAME);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   135
        } catch(Throwable e) {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   136
            System.out.println("Unexpected exception: " + e);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   137
            e.printStackTrace(System.out);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   138
            success = false;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   139
        }
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   140
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   141
        success &= checkTicketFlags();
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   142
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   143
        // kinit should succeed even if a principal name doesn't have realm
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   144
        command = new String[] {KINIT, "-k",
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   145
            "-J-Djava.security.krb5.conf=" + KRB5_CONF_FILENAME,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   146
            "-t", KEYTAB_FILE,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   147
            "-c", CC_FILENAME,
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   148
            USER
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   149
        };
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   150
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   151
        try {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   152
            OutputAnalyzer out = ProcessTools.executeCommand(command);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   153
            out.shouldHaveExitValue(0);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   154
            out.shouldContain(CC_FILENAME);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   155
        } catch(Throwable e) {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   156
            System.out.println("Unexpected exception: " + e);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   157
            e.printStackTrace(System.out);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   158
            success = false;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   159
        }
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   160
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   161
        success &= checkTicketFlags();
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   162
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   163
        if (!success) {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   164
            throw new RuntimeException("At least one test case failed");
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   165
        }
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   166
        System.out.println("Test passed");
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   167
    }
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   168
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   169
    // check if a ticket has forwardable and proxiable flags
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   170
    private static boolean checkTicketFlags() {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   171
        String[] command = new String[] {KLIST, "-f", "-c", CC_FILENAME};
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   172
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   173
        try {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   174
            OutputAnalyzer out = ProcessTools.executeCommand(command);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   175
            out.shouldHaveExitValue(0);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   176
            out.shouldContain("FORWARDABLE");
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   177
            out.shouldContain("PROXIABLE");
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   178
        } catch(Throwable e) {
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   179
            System.out.println("Unexpected exception: " + e);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   180
            e.printStackTrace(System.out);
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   181
            return false;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   182
        }
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   183
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   184
        return true;
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   185
    }
5c9c62dad68f 8075299: Additional tests for 6857795
asmotrak
parents:
diff changeset
   186
}