Special character in hostname may cause problem for built-in test suite

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Special character in hostname may cause problem for built-in test suite

Neng Xue
Hi,

Recently I noticed there is a problem running MIT built-in test suite on
a machine with special symbols in its hostname.

To be specific:

My machine's hostname is neng-kz

In this case, codes located in line 413 from

src/lib/kadm5/unit-test/api.current/init-v2.exp

will time/error out since it can only match special symbols '/@' as
specified in the regular expression. In my case, the hostname contains
symbol '-' which caused the expect script to error out.

-------------------------------------
send "puts \$KADM5_ADMIN_SERVICE\n"
expect {
-re "(\[a-zA-Z/@\]+)\n$prompt" {
set KADM5_ADMIN_SERVICE $expect_out(1,string)
}
default {
error_and_restart "$test: timeout/eof getting admin_service"
return
}
}
send "puts \$KADM5_CHANGEPW_SERVICE\n"
expect {
-re "(\[a-zA-Z/@\]+)\n$prompt" {
set KADM5_CHANGEPW_SERVICE $expect_out(1,string)
}
default {
error_and_restart "$test: timeout/eof getting changepw_service"
return
}
}
-------------------------------------
I confirmed that if I added '-' to the regular expression, the test
suite can match and pass.

So is this the expected behavior or can I work around it by not changing
my machine's hostname? Thanks.

Best
--
Neng Xue
Oracle Solaris Software Engineer
Santa Clara, CA, USA
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Special character in hostname may cause problem for built-in test suite

Tom Yu
Let's drop the bugs address from the CC for now, because I'm not
convinced this is our bug.

Neng Xue <[hidden email]> writes:

> Recently I noticed there is a problem running MIT built-in test suite on
> a machine with special symbols in its hostname.
>
> To be specific:
>
> My machine's hostname is neng-kz
>
> In this case, codes located in line 413 from
>
> src/lib/kadm5/unit-test/api.current/init-v2.exp
>
> will time/error out since it can only match special symbols '/@' as
> specified in the regular expression. In my case, the hostname contains
> symbol '-' which caused the expect script to error out.

Could you quote part of dbg.log from a test run where that fails to
match?  Are there any Solaris-specific changes that you've made to
libkadm5 or the testing scripts?  I seem to recall seeing a Solaris
change that prefers kadmin/FQDN for the kadmin service principal.

> I confirmed that if I added '-' to the regular expression, the test
> suite can match and pass.
>
> So is this the expected behavior or can I work around it by not changing
> my machine's hostname? Thanks.

This is not expected behavior.  I've successfully run the test suite
many times on hosts with hyphens in their hostnames.
$KADM5_ADMIN_SERVICE should be set to "kadmin/admin" by tcl_kadm5.c.  Is
that the case when you run the tests?  If you need the kadmin service
principal name to contain the hostname in that code, it would help to
know more about the rationale.

Thanks,
-Tom
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Special character in hostname may cause problem for built-in test suite

Neng Xue
Hi Tom,

On 09/ 8/16 04:42 AM, Tom Yu wrote:

> Let's drop the bugs address from the CC for now, because I'm not
> convinced this is our bug.
>
> Neng Xue <[hidden email]> writes:
>
>> Recently I noticed there is a problem running MIT built-in test suite on
>> a machine with special symbols in its hostname.
>>
>> To be specific:
>>
>> My machine's hostname is neng-kz
>>
>> In this case, codes located in line 413 from
>>
>> src/lib/kadm5/unit-test/api.current/init-v2.exp
>>
>> will time/error out since it can only match special symbols '/@' as
>> specified in the regular expression. In my case, the hostname contains
>> symbol '-' which caused the expect script to error out.
>
> Could you quote part of dbg.log from a test run where that fails to
> match?  Are there any Solaris-specific changes that you've made to
> libkadm5 or the testing scripts?  I seem to recall seeing a Solaris
> change that prefers kadmin/FQDN for the kadmin service principal.
>
Following is the part of dbg.log which caused timeout:

--------------------------
puts $KADM5_ADMIN_SERVICE
kadmin@neng-kz3
% ^M
expect: does "puts $KADM5_ADMIN_SERVICE\nkadmin@neng-kz3\n% " (spawn_id
exp10) match regular expression "([a-zA-Z/@]+)\n% "? Gate "*\n% "?
gate=yes re=no^M
expect: timedout^M
--------------------------

Exactly as you said, we are using kadmin/$hostname as kadmin service
principal. I think that was the root cause. I will talk to other Solaris
devs to work out the problem.

Thanks for the help here!

Best,
Neng

>> I confirmed that if I added '-' to the regular expression, the test
>> suite can match and pass.
>>
>> So is this the expected behavior or can I work around it by not changing
>> my machine's hostname? Thanks.
>
> This is not expected behavior.  I've successfully run the test suite
> many times on hosts with hyphens in their hostnames.
> $KADM5_ADMIN_SERVICE should be set to "kadmin/admin" by tcl_kadm5.c.  Is
> that the case when you run the tests?  If you need the kadmin service
> principal name to contain the hostname in that code, it would help to
> know more about the rationale.
>
> Thanks,
> -Tom
>

--
Neng Xue
Oracle Solaris Software Engineer
Santa Clara, CA, USA
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev