Skip to content

Commit 18a9de5

Browse files
committed
tests: add regression test for dir2index plugin
1 parent 320e54c commit 18a9de5

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

test/regression/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ set(BINARIES
9191
gufi_query
9292
gufi_stat_bin
9393
querydbs
94+
gufi_plugin
9495

9596
gufi_vt
9697
run_vt
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Creating GUFI Index search with 1 threads
2+
Total Dirs: 6
3+
Total Non-Dirs: 14
4+
5+
# test plugin summary output:
6+
file 6
7+
directory 1
8+
file 3
9+
directory 1
10+
file 0
11+
directory 1
12+
file 2
13+
directory 1
14+
file 1
15+
directory 1
16+
file 2
17+
directory 1

test/regression/gufi_plugin.sh.in

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/usr/bin/env bash
2+
# This file is part of GUFI, which is part of MarFS, which is released
3+
# under the BSD license.
4+
#
5+
#
6+
# Copyright (c) 2017, Los Alamos National Security (LANS), LLC
7+
# All rights reserved.
8+
#
9+
# Redistribution and use in source and binary forms, with or without modification,
10+
# are permitted provided that the following conditions are met:
11+
#
12+
# 1. Redistributions of source code must retain the above copyright notice, this
13+
# list of conditions and the following disclaimer.
14+
#
15+
# 2. Redistributions in binary form must reproduce the above copyright notice,
16+
# this list of conditions and the following disclaimer in the documentation and/or
17+
# other materials provided with the distribution.
18+
#
19+
# 3. Neither the name of the copyright holder nor the names of its contributors
20+
# may be used to endorse or promote products derived from this software without
21+
# specific prior written permission.
22+
#
23+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26+
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27+
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
31+
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32+
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
#
34+
#
35+
# From Los Alamos National Security, LLC:
36+
# LA-CC-15-039
37+
#
38+
# Copyright (c) 2017, Los Alamos National Security, LLC All rights reserved.
39+
# Copyright 2017. Los Alamos National Security, LLC. This software was produced
40+
# under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National
41+
# Laboratory (LANL), which is operated by Los Alamos National Security, LLC for
42+
# the U.S. Department of Energy. The U.S. Government has rights to use,
43+
# reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS
44+
# ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
45+
# ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is
46+
# modified to produce derivative works, such modified software should be
47+
# clearly marked, so as not to confuse it with the version available from
48+
# LANL.
49+
#
50+
# THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS
51+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
52+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53+
# ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR
54+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
55+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
56+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
57+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
58+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
59+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
60+
# OF SUCH DAMAGE.
61+
62+
63+
64+
set -e
65+
source @CMAKE_CURRENT_BINARY_DIR@/setup.sh 1
66+
67+
OUTPUT="gufi_plugin.out"
68+
69+
(
70+
# remove preexisting indicies
71+
rm -rf "${SEARCH}"
72+
73+
# generate the index
74+
"${GUFI_DIR2INDEX}" -x "${SRCDIR}" -U "@CMAKE_BINARY_DIR@/test/libtest_plugin.so" "${SEARCH}"
75+
76+
echo
77+
echo "# test plugin summary output:"
78+
79+
# make sure the plugin_test_summary table has the expected values for file and directory count:
80+
"${GUFI_QUERY}" -d " " -E "SELECT * FROM plugin_test_summary;" "${INDEXROOT}"
81+
82+
) | remove_indexing_time | tee "${OUTPUT}"
83+
84+
@DIFF@ @CMAKE_CURRENT_BINARY_DIR@/gufi_plugin.expected "${OUTPUT}"
85+
rm "${OUTPUT}"

0 commit comments

Comments
 (0)