#!/bin/sh
# PCP QA Test No. 1658
# Exercise pmlogextract with instances in config ... previously
# *all* instances were included, despite the restriction in the
# config file ... this seems to be related to just this archive,
# because attempts to reproduce this with smaller, simpler,
# archives were not successful.
#
# Copyright (c) 2026 Ken McDonell.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

_check_big_file bigarchives/all-ubuntu.22.04.index

_cleanup()
{
    cd $here
    $sudo rm -rf $tmp $tmp.*
}

status=0	# success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15

# real QA test starts here
cat <<End-of-File >$tmp.config
# from mk.all-ubuntu.22.04
proc.psinfo.cmd[2366,332881,3363]
End-of-File

pmlogextract -c $tmp.config bigarchives/all-ubuntu.22.04 $tmp

pminfo -a $tmp -f proc.psinfo.cmd

# success, all done
exit
