[CRIU] [PATCH] p.haul: fix zdtm test

Ruslan Kuprieiev kupruser at gmail.com
Wed Sep 2 09:09:21 PDT 2015


Oh, I see. Thanks.

On 02.09.15 17:54, Nikita Spiridonov wrote:
> We need this patch for our internal criu continiuous intergration tests;
> The problem is we run test/zdtm/run.sh with some namespaces unshared and
> make some additional configuration using environment variables (e.g.
> PATH variable to specify custom criu binary). It is hard or even
> impossible to preserve all this data for execed via ssh p.haul-service.
> p.haul-ssh is okay as far as I can see, it is not his fault.
>
> On Wed, 2015-09-02 at 18:35 +0300, Ruslan Kuprieiev wrote:
>> Oh dear, missed "Reply all" button. Sorry.
>>
>> On 02.09.15 18:34, Ruslan Kuprieiev wrote:
>>> Hi,
>>>
>>> Just for my information, are you suggesting this patch because
>>> you have some trouble running this test?
>>>
>>> I'm pretty sure it worked pretty well on localhost last time I've
>>> checked (it was a few months ago though).
>>>
>>> Maybe you are running as root and didn't allow root login in sshd config?
>>>
>>> Though, p.haul-ssh is pretty bad=) With current news on allowing splice()
>>> call on unix sockets in 4.2 kernel I'm thinking to get into encryption
>>> and
>>> compression once again.
>>>
>>> Thanks,
>>> Ruslan
>>>
>>> On 02.09.15 17:12, Nikita Spiridonov wrote:
>>>> Add "--local" option to zdtm test that makes it possible to run
>>>> test using local p.haul-service started in background bypassing
>>>> p.haul-ssh.
>>>>
>>>> Signed-off-by: Nikita Spiridonov <nspiridonov at odin.com>
>>>> ---
>>>>    test/zdtm/run.sh |   43 ++++++++++++++++++++++++++++++++++++++++++-
>>>>    1 files changed, 42 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/test/zdtm/run.sh b/test/zdtm/run.sh
>>>> index 430809a..08d3312 100755
>>>> --- a/test/zdtm/run.sh
>>>> +++ b/test/zdtm/run.sh
>>>> @@ -1,14 +1,47 @@
>>>>    #!/bin/bash
>>>> +
>>>> +exit_cleanup () {
>>>> +    if [ "x${LOCAL_PHS_PID}" != "x" ]; then
>>>> +        kill -TERM ${LOCAL_PHS_PID}
>>>> +    fi
>>>> +    return 0
>>>> +}
>>>> +
>>>>    set -x
>>>>    CRIU_PATH="../../../criu/"
>>>>    CRIU_TESTS="${CRIU_PATH}/test/zdtm/"
>>>>    WDIR="$(pwd)/wdir"
>>>>    PH=$(realpath ../../p.haul)
>>>>    PHS=$(realpath ../../p.haul-service)
>>>> +PHSSH=$(realpath ../../p.haul-ssh)
>>>> +
>>>> +# setup EXIT trap
>>>> +trap exit_cleanup EXIT
>>>> +
>>>> +# process command line options
>>>> +while [ "${#}" -gt 0 ]; do
>>>> +    case $1 in
>>>> +    "--local")
>>>> +        LOCAL_PHS="true"
>>>> +        ;;
>>>> +    esac
>>>> +    shift
>>>> +done
>>>>      rm -rf "$WDIR"
>>>>    mkdir "$WDIR"
>>>>    +# run local p.haul server in background if --local option specified
>>>> +if [ "x${LOCAL_PHS}" == "xtrue" ]; then
>>>> +    echo "Run local p.haul service"
>>>> +    ${PHS} &> "/tmp/phs.log" &
>>>> +    if [ ${?} -ne 0 ]; then
>>>> +        echo "Can't run local p.haul service"
>>>> +        exit 1
>>>> +    fi
>>>> +    LOCAL_PHS_PID=$!
>>>> +fi
>>>> +
>>>>    make ct_init
>>>>    if ! ./ct_init "${WDIR}/ct.log" "${WDIR}/init.pid" ./ct_init.py
>>>> ${CRIU_TESTS} tests; then
>>>>        echo "Start FAIL"
>>>> @@ -22,7 +55,15 @@ export PATH="${PATH}:${CRIU_PATH}"
>>>>    which criu
>>>>      echo "Migrating"
>>>> -if ! ../../p.haul-ssh --ssh-ph-exec ${PH} --ssh-phs-exec ${PHS} pid
>>>> ${PID} "127.0.0.1" -v=4 --keep-images --dst-rpid "${WDIR}/init2.pid"
>>>> --img-path "${WDIR}"; then
>>>> +if [ "x${LOCAL_PHS}" == "xtrue" ]; then
>>>> +    ${PH} pid ${PID} "127.0.0.1" -v=4 --keep-images \
>>>> +        --dst-rpid "${WDIR}/init2.pid" --img-path "${WDIR}"
>>>> +else
>>>> +    ${PHSSH} --ssh-ph-exec ${PH} --ssh-phs-exec ${PHS} pid ${PID}
>>>> "127.0.0.1" \
>>>> +        -v=4 --keep-images --dst-rpid "${WDIR}/init2.pid" --img-path
>>>> "${WDIR}"
>>>> +fi
>>>> +
>>>> +if [ ${?} -ne 0 ]; then
>>>>        echo "Migration failed"
>>>>        kill -TERM ${PID}
>>>>        exit 1
>



More information about the CRIU mailing list