@@ -16,50 +16,60 @@ FEATURE_FLAGS+=("gssapi-auth")
1616
1717set +o errexit
1818
19- # Create a krb5 config file with relevant
20- touch krb5.conf
21- echo " [realms]
22- $SASL_REALM = {
23- kdc = $SASL_HOST
24- admin_server = $SASL_HOST
25- }
26-
27- $SASL_REALM_CROSS = {
28- kdc = $SASL_HOST
29- admin_server = $SASL_HOST
30- }
31-
32- [domain_realm]
33- .$SASL_DOMAIN = $SASL_REALM
34- $SASL_DOMAIN = $SASL_REALM
35- " > krb5.conf
36-
37- export KRB5_CONFIG=krb5.conf
38-
39- # Authenticate the user principal in the KDC before running the e2e test
40- echo " Authenticating $PRINCIPAL "
41- echo " $SASL_PASS " | kinit -p $PRINCIPAL
42- klist
19+ # On Windows, `kinit`/`kdestroy` and other krb5 config settings are
20+ # not available, nor are they required steps. Windows uses SSPI which
21+ # is similar to but distinct from (KRB5) GSSAPI. Therefore, we only
22+ # run the following steps if we are not on Windows.
23+ if [[ " cygwin" != " $OSTYPE " ]]; then
24+ # Create a krb5 config file with relevant
25+ touch krb5.conf
26+ echo " [realms]
27+ $SASL_REALM = {
28+ kdc = $SASL_HOST
29+ admin_server = $SASL_HOST
30+ }
31+
32+ $SASL_REALM_CROSS = {
33+ kdc = $SASL_HOST
34+ admin_server = $SASL_HOST
35+ }
36+
37+ [domain_realm]
38+ .$SASL_DOMAIN = $SASL_REALM
39+ $SASL_DOMAIN = $SASL_REALM
40+ " > krb5.conf
41+
42+ export KRB5_CONFIG=krb5.conf
43+
44+ # Authenticate the user principal in the KDC before running the e2e test
45+ echo " Authenticating $PRINCIPAL "
46+ echo " $SASL_PASS " | kinit -p $PRINCIPAL
47+ klist
48+ fi
4349
4450# Run end-to-end auth tests for "$PRINCIPAL" user
4551TEST_OPTIONS+=(" --skip with_service_realm_and_host_options" )
4652cargo_test test::auth::gssapi_skip_local
4753
48- # Unauthenticate
49- echo " Unauthenticating $PRINCIPAL "
50- kdestroy
54+ if [[ " cygwin" != " $OSTYPE " ]]; then
55+ # Unauthenticate
56+ echo " Unauthenticating $PRINCIPAL "
57+ kdestroy
5158
52- # Authenticate the alternative user principal in the KDC and run other e2e test
53- echo " Authenticating $PRINCIPAL_CROSS "
54- echo " $SASL_PASS_CROSS " | kinit -p $PRINCIPAL_CROSS
55- klist
59+ # Authenticate the alternative user principal in the KDC and run other e2e test
60+ echo " Authenticating $PRINCIPAL_CROSS "
61+ echo " $SASL_PASS_CROSS " | kinit -p $PRINCIPAL_CROSS
62+ klist
63+ fi
5664
5765TEST_OPTIONS=()
5866cargo_test test::auth::gssapi_skip_local::with_service_realm_and_host_options
5967
60- # Unauthenticate
61- echo " Unuthenticating $PRINCIPAL_CROSS "
62- kdestroy
68+ if [[ " cygwin" != " $OSTYPE " ]]; then
69+ # Unauthenticate
70+ echo " Unauthenticating $PRINCIPAL_CROSS "
71+ kdestroy
72+ fi
6373
6474# Run remaining tests
6575cargo_test spec::auth
0 commit comments