Skip to content

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jun 2, 2021

relates to #549

Make sure that these versions are set, and match the expected versions

DEB:

   debian/rules override_dh_auto_test
make[1]: Entering directory '/root/build-deb'
ver="$(engine/bundles/dynbinary-daemon/dockerd --version)"; \
    test "$ver" = "Docker version 0.0.0-20210531142756-1c174ced, build 7c6a9484" && echo "PASS: daemon version OK" || echo "FAIL: daemon version ($ver) did not match"
PASS: daemon version OK
ver="$(cli/build/docker --version)"; \
    test "$ver" = "Docker version 0.0.0-20210531142756-1c174ced, build 1c174ced" && echo "PASS: cli version OK" || echo "FAIL: cli version ($ver) did not match"
PASS: cli version OK
# FIXME: --version currently doesn't work as it makes a connection to the daemon, so using the plugin metadata instead
ver="$(/usr/libexec/docker/cli-plugins/docker-scan docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }')"; \
    test "$ver" = "v0.8.0" && echo "PASS: docker-scan version OK" || echo "FAIL: docker-scan version ($ver) did not match"
PASS: docker-scan version OK

RPM:

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.SIDNvr
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd src
++ engine/bundles/dynbinary-daemon/dockerd --version
+ ver='Docker version 0.0.0-20210531142756-1c174ced, build 7c6a9484'
+ test 'Docker version 0.0.0-20210531142756-1c174ced, build 7c6a9484' = 'Docker version 0.0.0-20210531142756-1c174ced, build 7c6a9484'
+ echo 'PASS: daemon version OK'
+ exit 0
PASS: daemon version OK
...

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.jKzBxw
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd src
++ cli/build/docker --version
PASS: cli version OK
+ ver='Docker version 0.0.0-20210531142756-1c174ced, build 1c174ced'
+ test 'Docker version 0.0.0-20210531142756-1c174ced, build 1c174ced' = 'Docker version 0.0.0-20210531142756-1c174ced, build 1c174ced'
+ echo 'PASS: cli version OK'
+ exit 0
...
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.5KN9vp
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd src
++ /root/rpmbuild/BUILDROOT/docker-scan-plugin-0.8.0-0.el8.x86_64/usr/libexec/docker/cli-plugins/docker-scan docker-cli-plugin-metadata
++ awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }'
PASS: docker-scan version OK
+ ver=v0.8.0
+ test v0.8.0 = v0.8.0
+ echo 'PASS: docker-scan version OK'
+ exit 0

Make sure that these versions are set, and match the expected versions

DEB:

       debian/rules override_dh_auto_test
    make[1]: Entering directory '/root/build-deb'
    ver="$(engine/bundles/dynbinary-daemon/dockerd --version)"; \
        test "$ver" = "Docker version 0.0.0-20210531142756-1c174ced, build 7c6a9484" && echo "PASS: daemon version OK" || echo "FAIL: daemon version ($ver) did not match"
    PASS: daemon version OK
    ver="$(cli/build/docker --version)"; \
        test "$ver" = "Docker version 0.0.0-20210531142756-1c174ced, build 1c174ced" && echo "PASS: cli version OK" || echo "FAIL: cli version ($ver) did not match"
    PASS: cli version OK
    # FIXME: --version currently doesn't work as it makes a connection to the daemon, so using the plugin metadata instead
    ver="$(/usr/libexec/docker/cli-plugins/docker-scan docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }')"; \
        test "$ver" = "v0.8.0" && echo "PASS: docker-scan version OK" || echo "FAIL: docker-scan version ($ver) did not match"
    PASS: docker-scan version OK

RPM:

    Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.SIDNvr
    + umask 022
    + cd /root/rpmbuild/BUILD
    + cd src
    ++ engine/bundles/dynbinary-daemon/dockerd --version
    + ver='Docker version 0.0.0-20210531142756-1c174ced, build 7c6a9484'
    + test 'Docker version 0.0.0-20210531142756-1c174ced, build 7c6a9484' = 'Docker version 0.0.0-20210531142756-1c174ced, build 7c6a9484'
    + echo 'PASS: daemon version OK'
    + exit 0
    PASS: daemon version OK
    ...

    Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.jKzBxw
    + umask 022
    + cd /root/rpmbuild/BUILD
    + cd src
    ++ cli/build/docker --version
    PASS: cli version OK
    + ver='Docker version 0.0.0-20210531142756-1c174ced, build 1c174ced'
    + test 'Docker version 0.0.0-20210531142756-1c174ced, build 1c174ced' = 'Docker version 0.0.0-20210531142756-1c174ced, build 1c174ced'
    + echo 'PASS: cli version OK'
    + exit 0
    ...
    Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.5KN9vp
    + umask 022
    + cd /root/rpmbuild/BUILD
    + cd src
    ++ /root/rpmbuild/BUILDROOT/docker-scan-plugin-0.8.0-0.el8.x86_64/usr/libexec/docker/cli-plugins/docker-scan docker-cli-plugin-metadata
    ++ awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }'
    PASS: docker-scan version OK
    + ver=v0.8.0
    + test v0.8.0 = v0.8.0
    + echo 'PASS: docker-scan version OK'
    + exit 0

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

@fredericdalleau @glours ptal

Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@fredericdalleau fredericdalleau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fredericdalleau fredericdalleau merged commit dc6d0c5 into docker:master Jun 30, 2021
@thaJeztah thaJeztah deleted the add_version_checks branch June 30, 2021 07:54
@thaJeztah thaJeztah changed the title Add checks for binary versions set through build-time variables [master] add checks for binary versions set through build-time variables Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants