Project

General

Profile

Actions

Feature #12595

closed

restructure digest crypto-tests

Added by Patrick Mooney about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
tests
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

The message digest tests in the crypto-test framework have their test data vectors embedded directly into C files as byte arrays. While this makes for convenient access inside the test driver, rather than parsing from an external data file, it means the compiler is forced to deal with these large files during the build process. Empirical testing suggests the cost of that build is 2+ minutes on a fast machine. Parallelization of that build was attempted in Feature #12579: parallelize crypto-test build, but it raced on some machines, and was still computationally expensive for the task. Rather than incur this cost during every build, for tests which are very infrequently run, the tests should include the raw test data files and parse them at runtime.


Related issues

Related to illumos gate - Feature #12579: parallelize crypto-test buildClosedPatrick Mooney

Actions
Actions #1

Updated by Patrick Mooney about 2 years ago

Actions #2

Updated by Patrick Mooney about 2 years ago

With the change applied, the digest crypto tests pass as expected:

Test: /opt/crypto-tests/tests/digest/kcf/setup (run as root)      [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha1_32 (run as root)    [00:05] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha256_32 (run as root)  [00:05] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha384_32 (run as root)  [00:20] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha512_32 (run as root)  [00:20] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha512_224_32 (run as root) [00:20] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha512_256_32 (run as root) [00:20] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/md5_32 (run as root)     [00:07] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha1_64 (run as root)    [00:05] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha256_64 (run as root)  [00:05] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha384_64 (run as root)  [00:20] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha512_64 (run as root)  [00:20] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha512_224_64 (run as root) [00:20] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/sha512_256_64 (run as root) [00:20] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/md5_64 (run as root)     [00:07] [PASS]
Test: /opt/crypto-tests/tests/digest/kcf/cleanup (run as root)    [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha1_32 (run as root)   [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha256_32 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha384_32 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha512_32 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha512_224_32 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha512_256_32 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/md5_32 (run as root)    [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha1_64 (run as root)   [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha256_64 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha384_64 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha512_64 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha512_224_64 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/sha512_256_64 (run as root) [00:00] [PASS]
Test: /opt/crypto-tests/tests/digest/pkcs/md5_64 (run as root)    [00:00] [PASS]
Actions #3

Updated by Patrick Mooney about 2 years ago

To double-check that the tests are in fact using the bundled response files, I edited them to introduce small changes (resulting in digests which shouldn't match) and confirmed that the tests noted the divergence and emitted failures.

Actions #4

Updated by Electric Monk about 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 080adf9151dd071434400f6061c837f7421eca5f

commit  080adf9151dd071434400f6061c837f7421eca5f
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2020-04-28T16:27:12.000Z

    12595 restructure digest crypto-tests
    Reviewed by: Jason King <jason.king@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF