lkl: timeout dhcp request ealier if not available#324
Conversation
|
This should fix #285. Cc: @liuyuan10 |
| sudo ./net-test raw ${IFNAME} ${DST} dhcp | ||
| sudo ./net-test raw ${IFNAME} ${DST} dhcp & | ||
| sleep 5 | ||
| sudo killall -q net-test && (echo "killed, skipped") |
There was a problem hiding this comment.
I don't know how it works. If killall doesn't find net-test, it still return 1 which is considered a failure by the script?
There was a problem hiding this comment.
if kilall doesn't find, it return 0, keep quiet (-q) and goto next
if killall finds, return 1 and report via echo ..., but no error.
hmm, there is no chance to report an error with dhcp test now..
if there were a way to predict that dhcp works, this check can be expanded but dunno how.
There was a problem hiding this comment.
Maybe we should use an env variable to specificy if DHCP test should run? Then we can set it in those environments where we know it runs.
There was a problem hiding this comment.
ah, that's a good idea.
maybe we can introduce LKL_TEST_DHCP for circleci environment, then timeout should not be needed.
will resubmit a patch.
72c9393 to
ac747c3
Compare
By default, make test won't test with dhcp client. If the environmental variable LKL_TEST_DHCP is configured, it will be tested. Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
ac747c3 to
274b5bf
Compare
|
Just curious, killall -q xxx || echo $? prints 1 instead of 0 on my desktop. So killall -q xxx && echo "hello" won't print but is an error. What am I missing here? |
|
All your results make sense to me.
This is an OR condition. The 2nd statement is not evaluated if the 1st one is true.
This is an AND condition. The 2nd statement is not evaluated if the 1st one is false. in those case, (return value = 0) is true while (return value !=0) is false (this is a bit complicated part to me).
|
|
You explanation is correct. That's why I'm wondering how the "sudo killall
-q net-test && (echo "killed, skipped")" can work. It seems to me just
work in the opposite way. If net-test is not there, killall returns 1 and
the test will fail.
…On Tue, Feb 14, 2017 at 3:26 PM, Hajime Tazaki ***@***.***> wrote:
All your results make sense to me.
Just curious, killall -q xxx || echo $?
This is an OR condition. The 2nd statement is not evaluated if the 1st one
is true.
killall -q xxx && echo "hello"
This is an AND condition. The 2nd statement is not evaluated if the 1st
one is false.
in those case, (return value = 0) is true while (return value !=0) is
false (this is a bit complicated part to me).
- killall(1)
killall returns a zero return code if at least one process has been killed for each listed command, or no commands were listed and at least one process matched the -u and -Z search criteria. killall returns non-zero otherwise.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#324 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AEVfUvpoBiScbH3xfOQOYKmXPJrStLaeks5rcjgcgaJpZM4MACpY>
.
|
|
@liuyuan10 your curious is right. in short, there was an error. my intention of the original patch (now diminished) was
so I didn't intended to report an error after this test. OTOH, the circleci test passed my patch with the above 2nd case with the Exit code 0 (no error) so I was thinking that the above cases were working fine. the statement it looks like there was something odd. if I changed my patch like below, it will report an error. so, again, you caught a good point. |
Signed-off-by: Hajime Tazaki thehajime@gmail.com
This change is