Skip to content

Improvement: Skip rdrand tests if the CPU does not support them #115

Description

@mikatammi

Currently if you run "rdrand" tests and the CPU platform does not support hwrand, the tests just fail. Could we improve this, so that if the CPU being used does not support the feature, the test would be simply skipped?

I'm doing maintenance for the NixOS package NixOS/nixpkgs#472498 , and I was going to enable all the testcases again, but I still need to skip these specific tests if the package is being built on aarch64-linux platform as the NixOS CI build infrastructure uses arm64-linux builder which does not seem to support it. aarch64-darwin seems to be fine though.

Maybe somehow from the testcase we could call the same function Botan::Processor_RNG::available() that is called from here: https://github.com/randombit/botan/blob/master/src/lib/ffi/ffi_rng.cpp#L51 . Or implement some other kind of check

rdrand
  rngInit [✘]
  rngGet [✘]
  rngReseed [✘]
  rngReseedFromRNGCtx [✘]
  rngAddEntropy [✘]

Failures:

  test/Botan/Low/RNGSpec.hs:23:9:
  1) rdrand rngInit
       uncaught exception: SomeBotanException
       NotImplementedException (-40) "" [("throwBotanIfNegative_",SrcLoc {srcLocPackage = "botan-low-0.0.2.0-G4WRDaW90LG>

  To rerun use: --match "/rdrand/rngInit/" --seed 2066260477

  test/Botan/Low/RNGSpec.hs:26:9:
  2) rdrand rngGet
       uncaught exception: SomeBotanException
       NotImplementedException (-40) "" [("throwBotanIfNegative_",SrcLoc {srcLocPackage = "botan-low-0.0.2.0-G4WRDaW90LG>

  To rerun use: --match "/rdrand/rngGet/" --seed 2066260477

  test/Botan/Low/RNGSpec.hs:30:9:
  3) rdrand rngReseed
       uncaught exception: SomeBotanException
       NotImplementedException (-40) "" [("throwBotanIfNegative_",SrcLoc {srcLocPackage = "botan-low-0.0.2.0-G4WRDaW90LG>

  To rerun use: --match "/rdrand/rngReseed/" --seed 2066260477

  test/Botan/Low/RNGSpec.hs:34:9:
  4) rdrand rngReseedFromRNGCtx
       uncaught exception: SomeBotanException
       NotImplementedException (-40) "" [("throwBotanIfNegative_",SrcLoc {srcLocPackage = "botan-low-0.0.2.0-G4WRDaW90LG>

  To rerun use: --match "/rdrand/rngReseedFromRNGCtx/" --seed 2066260477

  test/Botan/Low/RNGSpec.hs:39:9:
  5) rdrand rngAddEntropy
       uncaught exception: SomeBotanException
       NotImplementedException (-40) "" [("throwBotanIfNegative_",SrcLoc {srcLocPackage = "botan-low-0.0.2.0-G4WRDaW90LG>

  To rerun use: --match "/rdrand/rngAddEntropy/" --seed 2066260477

Metadata

Metadata

Assignees

Labels

botan-lowRelated to the botan-low packagebugSomething isn't workingpriority: hightestingRelated to testing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions