<commit_before>#!/usr/bin/env bash

# Copyright 2009 Red Hat Inc., Durham, North Carolina.
# All Rights Reserved.
#
# OpenScap Probes Test Suite.
#
# Created on: Nov 30, 2009
#
# Authors:
#      <NAME>, <<EMAIL>>
#      <NAME>
#      <NAME>, <<EMAIL>>

. ../../test_common.sh

# Test Cases.

function test_probes_filehash58 {

    probecheck "filehash58" || return 255
    require "md5sum" || return 255
    require "sha1sum" || return 255

    local ret_val=0;
    local DF="test_probes_filehash58.xml"
    local RF="results.xml"

    [ -f $RF ] && rm -f $RF

    bash ${srcdir}/test_probes_filehash58.xml.sh > $DF
    $OSCAP oval eval --results $RF $DF
    
    if [ -f $RF ]; then
	verify_results "def" $DF $RF 13 && verify_results "tst" $DF $RF 120
	ret_val=$?
    else 
	ret_val=1
    fi

    # The file was created as a side-effect of test_probes_filehash58.xml.sh
    [ $ret_val -eq 0 ] && rm -f /tmp/test_probes_filehash58.tmp

    return $ret_val
}


# $1: The chroot directory
function test_probes_filehash58_chroot {

    probecheck "filehash58" || return 255
    require "sha1sum" || return 255<commit_msg>Removed an unnecessary test dependency.<commit_after>#!/usr/bin/env bash

# Copyright 2009 Red Hat Inc., Durham, North Carolina.
# All Rights Reserved.
#
# OpenScap Probes Test Suite.
#
# Created on: Nov 30, 2009
#
# Authors:
#      <NAME>, <<EMAIL>>
#      <NAME>
#      <NAME>, <<EMAIL>>

. ../../test_common.sh

# Test Cases.

function test_probes_filehash58 {

    probecheck "filehash58" || return 255
    require "md5sum" || return 255
    require "sha1sum" || return 255

    local ret_val=0;
    local DF="test_probes_filehash58.xml"
    local RF="results.xml"

    [ -f $RF ] && rm -f $RF

    bash ${srcdir}/test_probes_filehash58.xml.sh > $DF
    $OSCAP oval eval --results $RF $DF
    
    if [ -f $RF ]; then
	verify_results "def" $DF $RF 13 && verify_results "tst" $DF $RF 120
	ret_val=$?
    else 
	ret_val=1
    fi

    # The file was created as a side-effect of test_probes_filehash58.xml.sh
    [ $ret_val -eq 0 ] && rm -f /tmp/test_probes_filehash58.tmp

    return $ret_val
}


# $1: The chroot directory
function test_probes_filehash58_chroot {

    probecheck "filehash58" || return 255
{'fraction_non_alphanumeric': 0.1289308176100629, 'fraction_numerical': 0.04582210242587601, 'mean_word_length': 2.927689594356261, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3394930', 'n_tokens_mistral': 910, 'n_tokens_neox': 808, 'n_words': 227}