File: 501

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (104 lines) | stat: -rwxr-xr-x 3,136 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#! /bin/sh
# PCP QA Test No. 501
# COPY of PCP QA Test No. 413 with different 2.0/2.0+ output ...
# #552517 pmie dumps core with bad metric and -V or -W
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

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

rm -f $seq.out
case $PCP_PLATFORM
in
    linux|darwin|solaris|freebsd|netbsd|openbsd)
	ln $seq-linux.out $seq.out || exit 1
	;;
    *)
	_notrun "Need qualified output for $PCP_PLATFORM"
	;;
esac

# get standard filters
. ./common.product
. ./common.filter
. ./common.check

_need_metric mem.physmem

status=0	# success is the default!
host=`hostname`
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
$sudo rm -f core* $seq.core*

_filter()
{
    _filter_pmie_log \
    | sed \
        -e 's/:  *[0-9][0-9]*\.[0-9]*e[-+][0-9][0-9]*/: NUMBER/' \
        -e 's/:  *[0-9][0-9]*e[-+][0-9][0-9]*/: NUMBER/' \
        -e 's/:  *[0-9][0-9]*\.[0-9]*/: NUMBER/' \
        -e 's/:  *[0-9][0-9]*/: NUMBER/' \
        -e "s/$host/HOST/" \
	-e "s/local:/HOST/"
}

# real QA test starts here

for arg in -v -V -W
do
    echo
    echo "=== pmie $arg ... ==="
    cat <<End-of-File | pmie -f -l $tmp.log $arg -t 2sec -T 3sec >$tmp.out
// arithmetic expressions
valid_a = hinv.ncpu;
alone_a = no.such.metric;
sum1_a = mem.physmem + no.such.metric;
sum2_a = no.such.metric + mem.physmem;
product_a = no.such.metric * hinv.physmem;
compound1_a = mem.physmem + no.such.metric * hinv.ncpu;
compound2_a = (no.such.metric + mem.physmem) * hinv.ncpu;

// boolean expressions
valid_b = 0 < hinv.ncpu;
alone_b = 0 < no.such.metric;
sum1_b = 0 < mem.physmem + no.such.metric;
sum2_b = 0 < no.such.metric + mem.physmem;
product_b = 0 < no.such.metric * hinv.physmem;
compound1_b = 0 < mem.physmem + no.such.metric * hinv.ncpu;
compound2_b = 0 < (no.such.metric + mem.physmem) * hinv.ncpu;

// existential expressions
valid_s = some_inst 500 < sample.bin;
alone_s = some_inst 0 < no.such.metric;
sum1_s = some_inst 0 < sample.bin + no.such.metric;
sum2_s = some_inst 0 < no.such.metric + sample;
product_s = some_inst 0 < no.such.metric * sample.bin;
compound1_s = some_inst 0 < sample.bin + no.such.metric * sample.bin;
compound2_s = some_inst 0 < (no.such.metric + mem.physmem) * hinv.ncpu;

// no support
one = sample.long.one;
no1 = sample.bad.nosupport;
no2 = sample.long.one + sample.bad.nosupport;
mill = -1 * (sample.long.one - (sample.long.one + sample.long.ten + sample.long.million)) / sample.long.one;
no3 = (sample.long.one - (sample.long.one + sample.long.ten + sample.bad.nosupport)) / sample.long.one;
no4 = (sample.long.one - (sample.long.one + sample.long.ten + sample.long.million)) / sample.bad.nosupport;

// not-numeric
notnum1 = sample.string.hullo;
notnum2 = "g'day" != sample.string.hullo;
notnum3 = sample.string.hullo == "hullo world!" && 0 <= (sample.long.one - (sample.long.one + sample.long.ten) / sample.long.one);
notnum4 = (sample.long.one - (sample.long.one + sample.long.ten + sample.long.million)) >= 0 && sample.string.hullo == "hullo world!";


End-of-File

    cat $tmp.out $tmp.log | tee -a $seq_full | _filter

    echo
    _check_core
done

exit