<commit_before>#!/bin/bash

set -e
set -o pipefail

name=$(basename $0 .sh)
stderr=$(mktemp -t ${name}.err.XXXXXX)
echo "Stderr file = $stderr"

$OSCAP info ${srcdir}/${name}.xccdf.xml 2> $stderr
[ -f $stderr ]
[ -s $stderr ]
cat $stderr | head -n 1 | grep '^OpenSCAP Error:'

rm $stderr<commit_msg>tests: workaround trac#346, disable test on RPM systems with older libxml2<commit_after>#!/bin/bash

set -e
set -o pipefail

if [ -f /bin/rpm ] && /bin/rpm -q libxml2; then
	# workaround trac#346: skip this test
	version="`/bin/rpm -q --qf %{VERSION} libxml2`";
	if echo $version | \
			awk -F. '{print ($1 == 2 && ($2 < 7 || ($2 == 7 && $3 <= 6))) ? "true" : "false"}' | \
			grep true; then
		exit 0;
	fi
fi

name=$(basename $0 .sh)
stderr=$(mktemp -t ${name}.err.XXXXXX)
echo "Stderr file = $stderr"

$OSCAP info ${srcdir}/${name}.xccdf.xml 2> $stderr
[ -f $stderr ]
[ -s $stderr ]
cat $stderr | head -n 1 | grep '^OpenSCAP Error:'

rm $stderr
{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.025396825396825397, 'mean_word_length': 3.4205607476635516, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, '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': '1360171', 'n_tokens_mistral': 412, 'n_tokens_neox': 377, 'n_words': 119}