1*66bae5e7Schristos#! /usr/bin/env perl 2*66bae5e7Schristos# Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 3*66bae5e7Schristos# 4*66bae5e7Schristos# Licensed under the Apache License 2.0 (the "License"). You may not use 5*66bae5e7Schristos# this file except in compliance with the License. You can obtain a copy 6*66bae5e7Schristos# in the file LICENSE in the source distribution or at 7*66bae5e7Schristos# https://www.openssl.org/source/license.html 8*66bae5e7Schristos 9*66bae5e7Schristosuse strict; 10*66bae5e7Schristosuse warnings; 11*66bae5e7Schristos 12*66bae5e7Schristosuse OpenSSL::Test; 13*66bae5e7Schristos 14*66bae5e7Schristossetup("test_legacy"); 15*66bae5e7Schristos 16*66bae5e7Schristosplan tests => 3; 17*66bae5e7Schristos 18*66bae5e7Schristosok(run(app(['openssl', 'rand', '-out', 'rand.txt', '256'])), "Generate random file"); 19*66bae5e7Schristos 20*66bae5e7Schristosok(run(app(['openssl', 'dgst', '-sha256', 'rand.txt'])), "Generate a digest"); 21*66bae5e7Schristos 22*66bae5e7Schristosok(!run(app(['openssl', 'dgst', '-sha256', '-propquery', 'foo=1', 23*66bae5e7Schristos 'rand.txt'])), "Fail to generate a digest"); 24