2 # Attempt to import our test XML twice; all attempts after the first
6 # First, we remove any leftover mess.
7 rm -f shelltest.sqlite3
10 # Now we run the import/migrate silently.
11 ./dist/build/htsn-import/htsn-import -c 'shelltest.sqlite3' test/xml/*.xml > /dev/null
14 # We note the number of XML files that we have. There's one extra
15 # Heartbeat.xml that doesn't really count.
16 find ./test/xml -maxdepth 1 -name '*.xml' | wc -l
21 # Run the imports again; we should get complaints about the duplicate
22 # xml_file_ids. There are 2 errors for each violation, so we expect 2*16
23 # occurrences of the string 'ERROR'.
24 ./dist/build/htsn-import/htsn-import -c 'shelltest.sqlite3' test/xml/*.xml 2>&1 | grep ERROR | wc -l
29 # Finally, clean up after ourselves.
30 rm -f shelltest.sqlite3