Login Register Actian.com  

Actian Community Wiki

Navigation
Learn About
Developing With
Ingres Talk
Information
Toolbox

Test Suite

From Ingres Community Wiki

Jump to: navigation, search

Contents

Getting Started: Ingres Test Suite

The latest version of Ingres comes with a large number of SEP tests for validating database operation.

Note: Code examples use '/ingres' for the ingres root, 'T1' (Test 1) for the installation ID; you should replace these with the actual location of your code and actual installation code used for your installation.

Note for Ubuntu users

Ubuntu Linux from 8.0 onwards links the bourne shell to "dash", you can see this if you run "ls -l /bin/sh". "dash" is a lightweight shell that does not fully support all bourne shell syntax; some bourne shell syntax used in the Ingres scrips will not work in "dash"; Ubuntu users are therefore advised to re-link "sh" to "bash". Also, on some Ubuntu distributuins the program "basename" is not found in /bin, bit in /usr/bin; the Ingres scripts expect it to be in /bin, so it should be linked there. As root you should:

sudo dpkg-reconfigure dash
ln -s /usr/bin/basename /bin/basename

Note for users of GCC version 4.3

As of (about) 10.0 build 106, Ingres builds created with this version of the compiler should pass the test suite. However, experience with gcc 4.3 is still somewhat limited as of this writing (Sep 09). If your build with gcc 4.3 does not pass, and you cannot find any other reason for the problems, double-check for function return type mismatches. (For example, function f() returns bool, but it's not declared at the point of call, making the caller implicitly expect an int return. This no longer works with gcc 4.3.) Please see the warning at the bottom of this page:

http://community.ingres.com/wiki/Building_Ingres_FAQ

Testing From Source (buildAndTest)

The Ingres database source code is frequently updated, so failed tests on old code may no longer be relevant. If your source is out of date, or you don't have any yet, it is best to start fresh from the subversion repository.

mkdir /ingres
svn co http://code.ingres.com/ingres/main /ingres

From there, a single script can compile, install, and test the Ingres database for you. This process takes several hours and several GB of hard drive space. When running the complete build and test script you should do so as root. Since the script sets up the environment, in order to avoid issues with residual environment setting from previous installations or test runs you should start with a "clean" shell; that is, one that has never had an Ingres environment set for it, ideally you would create a new terminal window as root, or sudo or su to root and immediately cd to /ingres/buildtools and run the script.

(as root)
./ingres/buildtools/buildAndTest.sh T1

Continue to Reading Output

Customising 'buildAndTest.sh'

If you're doing this for a while, it wouldn't be a bad idea to examine the contents of 'buildAndTest.sh' at some point. Simple changes might include removing the line that resets file permissions, so you won't have to chown all the files back to the 'ingres' user to run subsequent tests.

What are some other good ideas?

Testing After Compile (for developers who wish to test their code changes)

If you have already compiled a recent source revision, or you have made code changes and re-built already, and want to run the test suite without recompiling, you can follow these steps in the order specified to test your already built code.

1. Re-setting permissions

Since the 'buildAndTest.sh' script resets permissions after execution, you'll need to give everything back to the 'ingres' user. You will only need to do this if you have previously run buildAndTest.sh.

(as root)
chown -R ingres:ingres /ingres 

2. Creating Users needed for Ingres testing

If you have not previously run buildAndTest.sh on this machine you will need to create the accounts that Ingres uses for testing. Using your system tools (either useradd or some other GUI tool) create the users ingres, pvusr1, pvusr2, pvusr3, pvusr4, and testenv. The password for testenv must be set to "ca-testenv" for the tests to complete successfully.

3. Creating an Ingres installation to test with

If you have not already done so, you will need to make an Ingres installation to test the build. We will assume from here on in that the Ingres installation code is T1, if you have an existing installation that uses a different installation code, then replace "T1" with that code in future commands in this page.

(as ingres)
cd /ingres/buildtools
source set_env.sh
createdbms T1
source test_env.sh T1


4. Re-setting the test output area when running tests again on an existing Ingres installation

If you have a pre-existing Ingres installation on which you have already run tests, you'll also want to reset the output folder, as previous test output would still be there.

(as ingres)
rm -rf $II_SYSTEM/output
mkdir $II_SYSTEM/output
chmod 777 $II_SYSTEM/output


5. Copying the test suite to your Install area

If you have not previously run buildAndTest.sh using this Ingres installation you will need to copy the test suite to the root location of the installation

(as ingres)
mkdir $II_SYSTEM/tst
cp -r $TST_LOC $II_SYSTEM/tst


6. Running the "root" setup script

If this is the first time you are running tests on this installation, you will need to run the root setup script as root

(as root)
cd /ingres/buildtools
source root_setup.sh

7. Running the tests

Now you are ready to run the test suite, you will do this as user testenv; since the script sets up your environment, you will not need to do that beforehand, simply switch user to testenv and run the script.

(as testenv)
cd /ingres/buildtools
source runtest.sh T1

Reading Output

Output is saved in four places:

The compile log displays thorough output from the compile process. Search this for "failed". If something failed during the compile, then it will probably be the cause for errors in subsequent tests.

/ingres/logs/jam_<timestamp>.log

The test automation script log displays timestamps for when each set of tests started and finished.

/ingres/install/T1/output/my_test_run.log

The test logs are stored in a very straightforward manner. Keep in mind there will only be log files if something went wrong, but other files will always be present regardless of errors.

/ingres/install/T1/output/<category>/<subcategory>/<testid>.log
example - /ingres/install/T1/output/be/access/am26.log

The Ingres database error log will contain a lot of errors, because some tests are for what the database should not do.

/ingres/install/T1/ingres/files/errlog.log

How do I know that the tests are successful

As a developer, in order to submit your changes back to the code management system you will need to demonstrate that you have run the acceptance tests and have not caused any additional issues (regressions). Because of the nature of a development code-line some tests will produce output that is not identical to the canonical files (the default expected output). If you are running tests for code submission, it is recommended that you use a revision of the code from one of the Ingres "tags". Approximately every 2 weeks and new "checkpoint" of the code is made, at this time the latest revision of the code is pulled, built, and tested. The results of the tests are posted on this page (see below), and a new "tag" is created. If you use one of the "tags" listed below you can be sure that any deviation from the baseline results posted below are a result of your code changes or your environment.

Quick sanity check of results

Once your testing is complete the results are located in the output directory below the root of your installation (that is, $II_SYSTEM/output). You should first obtain the "baseline" results for your tag from the link below and extract the file out to another location (e.g. in /tmp). If any tests differ from the expected results the log file for that test is retained, otherwise the log file is deleted after the test completes. The following commands will tell you which tests produced different results than expected.

cd $II_SYSTM/output
find . -name \*.log -print

You should also run this command in the area where you extracted the baseline results from below. If you have the same log files as the baseline you are almost done. If you do not, you should check those log files to find out why.

Even if you do have the same log files as the baseline, you should check them anyway to make sure that your diffs are the same as those in the baseline.

Checking log files for diffs

For each log file you find above, you should edit the file and find the string "DIFF" (this may be repeated several times in the log if there are several diffs). The log will display the output from your test run, the output expected from the canonical file, and the difference between them. This may be enough to find the problem. If you need to know more about what is being run at the time you can look at the original "sep" file that generated the log, these can be found below the "src/tst" directory in the root of your code line. look for a file with the same name as the log, but with extension ".sep".

If you have the same log files as the baseline, and your diffs are the same as those in the baseline your tests have completed successfully and you can submit your change (after following the correct submission procedure). If you have log files that the baseline does not, or if your log files contain different results to the baseline, you should investigate the diffs and work out why. If you are unsure of what is causing your diffs you should post to the forums and the Ingres developers will help you.

Test Results

The test logs contain directories that correspond to individual test suites. The files that need to be examined after the tests have completed are those with the .rpt filetype. Each test suite directory will have one .rpt file. The .rpt file contains a summary of all the problems found in the suite and a count of the number of problems found in each test. For each test that detected problems, there will also be a separate .log file which contains the details of the differences that were identified.

Since the Community version of Ingres is constantly being updated, there are bound to be problems and differences that have not been corrected yet. In order for Open Source Ingres developers to know whether the test differences that they encounter are caused by their changes or are pre-existing, there are reference test output logs which can be used for comparison.

The following output logs have been created for each checkpoint build and corresponds to the source revision in the specified subversion Tag.

Ingres 10.1 Test output archive files
Checkpoint Build Name Subversion Tag Output Archive File
Ingres 10.1 build 124 2011-10-12 ingres_1010_build_124_alpha media:Test_Output_intlnx_1010_b124_2011-10-12.tar.gz
Ingres 10.1 build 123 2011-08-17 ingres_1010_build_123_alpha media:Test_Output_intlnx_1010_b123_2011-08-17.tar.gz
Ingres 10.1 build 122 2011-07-20 ingres_1010_build_122b_alpha media:Test_Output_intlnx_1010_b122_2011-07-20.tar.gz
Ingres 10.1 build 120 2011-05-27 ingres_1010_build_120_alpha media:Test_Output_intlnx_1010_b120_2011-05-27.tar.gz
Ingres 10.1 build 118 2011-04-13 ingres_1010_build_118_alpha media:Test_Output_intlnx_1010_b118_2011-04-13.tar.gz
Ingres 10.1 build 116 2011-03-16 ingres_1010_build_116_alpha media:Test_Output_intlnx_1010_b116_2011-03-16.tar.gz
Ingres 10.1 build 114 2011-02-16 ingres_1010_build_114_alpha media:Test_Output_intlnx_1010_b114_2011-02-16.tar.gz
Ingres 10.1 build 112 2011-01-19 ingres_1010_build_112_alpha media:Test_Output_intlnx_1010_b112_2011-01-19.tar.gz
Ingres 10.1 build 111 2011-01-05 ingres_1010_build_111_alpha media:Test_Output_intlnx_1010_b111_2011-01-05.tar.gz
Ingres 10.1 build 110 2010-12-15 ingres_1010_build_110_alpha media:Test_Output_intlnx_1010_b110_2010-12-15.tar.gz
Ingres 10.1 build 109 2010-12-01 ingres_1010_build_109_alpha media:Test_Output_intlnx_1010_b109_2010-12-01.tar.gz
Ingres 10.1 build 108 2010-11-17 ingres_1010_build_108_alpha media:Test_Output_intlnx_1010_b108_2010-11-17.tar.gz
Ingres 10.1 build 107 2010-11-03 ingres_1010_build_107_alpha media:Test_Output_intlnx_1010_b107_2010-11-03.tar.gz
Ingres 10.1 build 106 2010-10-20 ingres_1010_build_106_alpha media:Test_Output_intlnx_1010_b106_2010-10-20.tar.gz
Ingres 10.1 build 105 2010-10-06 ingres_1010_build_105_alpha media:Test_Output_intlnx_1010_b105_2010-10-06.tar.gz
Ingres 10.1 build 104 2010-09-22 ingres_1010_build_104_alpha media:Test_Output_intlnx_1010_b104_2010-09-22.tar.gz
Ingres 10.1 build 103 2010-09-08 ingres_1010_build_103_alpha media:Test_Output_intlnx_1010_b103_2010-09-08.tar.gz
Ingres 10.1 build 102 2010-08-18 ingres_1010_build_102_alpha media:Test_Output_intlnx_1010_b102_2010-08-18.tar.gz
Ingres 10.1 build 101 2010-08-04 ingres_1010_build_101_alpha media:Test_Output_intlnx_1010_b101_2010-08-04.tar.gz
Ingres 10.1 build 100 2010-07-21 ingres_1010_build_100_alpha media:Test_Output_intlnx_1010_b100_2010-07-21.tar.gz



Ingres 10.0 Test output archive files
Checkpoint Build Name Subversion Tag Output Archive File
Ingres 10.0 build 127 2010-06-30 ingres_1000_build_127_alpha media:Test_Output_intlnx_1000_b127_2010-06-30.tar.gz
Ingres 10.0 build 126 2010-06-16 ingres_1000_build_126_alpha media:Test_Output_intlnx_1000_b126_2010-06-16.tar.gz
Ingres 10.0 build 125 2010-06-01 ingres_1000_build_125_alpha media:Test_Output_intlnx_1000_b125_2010-06-01.tar.gz
Ingres 10.0 build 124 2010-05-19 ingres_1000_build_124_alpha media:Test_Output_intlnx_1000_b124_2010-05-19.tar.gz
Ingres 10.0 build 123 2010-05-05 ingres_1000_build_123_alpha media:Test_Output_intlnx_1000_b123_2010-05-05.tar.gz
Ingres 10.0 build 122 2010-04-21 ingres_1000_build_122_alpha media:Test_Output_intlnx_1000_b122_2010-04-21.tar.gz
Ingres 10.0 build 121 2010-04-07 ingres_1000_build_121_alpha media:Test_Output_intlnx_1000_b121_2010-04-07.tar.gz
Ingres 10.0 build 120 2010-03-24 ingres_1000_build_120_alpha media:Test_Output_intlnx_1000_b120_2010-03-24.tar.gz
Ingres 10.0 build 119 2010-03-08 ingres_1000_build_119_alpha media:Test_Output_intlnx_1000_b119_2010-03-08.tar.gz
Ingres 10.0 build 118 2010-02-24 ingres_1000_build_118_alpha media:Test_Output_intlnx_1000_b118_2010-02-24.tar.gz
Ingres 10.0 build 117 2010-02-10 ingres_1000_build_117_alpha media:Test_Output_intlnx_1000_b117_2010_02_10.tar.gz
Ingres 10.0 build 116 2010-01-27 ingres_1000_build_116_alpha media:Test_Output_intlnx_1000_b116_2010-01-27.tar.gz
Ingres 10.0 build 115 2010-01-13 ingres_1000_build_115_alpha media:Test_Output_intlnx_1000_b115_2010-01-13.tar.gz
Ingres 10.0 build 114 2009-12-28 ingres_1000_build_114_alpha media:Test_Output_intlnx_1000_b114_2009-12-28.tar.gz
Ingres 10.0 build 113 2009-12-09 ingres_1000_build_113_alpha media:Test_Output_intlnx_1000_b113_2009-12-09.tar.gz
Ingres 10.0 build 112 2009-11-23 ingres_1000_build_112_alpha media:Test_Output_intlnx_1000_b112_2009-11-23.tar.gz
Ingres 10.0 build 111 2009-11-11 ingres_1000_build_111_alpha media:Test_Output_intlnx_1000_b111_2009-11-11.tar.gz
Ingres 10.0 build 110 2009-10-28 ingres_1000_build_110_alpha media:Test_Output_intlnx_1000_b110-2009-10-28.tar.gz
Ingres 10.0 build 109 2009-10-14 ingres_1000_build_109_alpha media:Test_Output_intlnx_1000_b109_2009-10-14.tar.gz
Ingres 10.0 build 108 2009-09-30 ingres_1000_build_108_alpha media:Test_Output_intlnx_1000_b108_2009-09-30.tar.gz
Ingres 10.0 build 107 2009-09-16 ingres_1000_build_107_alpha media:Test_Output_intlnx_1000_b107_2009-09-16.tar.gz
Ingres 10.0 build 106 2009-09-02 ingres_1000_build_106_alpha media:Test_Output_intlnx_1000_b106_2009-09-02.tar.gz
Ingres 10.0 build 105 2009-08-10 ingres_1000_build_105_alpha media:Test_Output_intlnx_1000_b105_2009-08-19.tar.gz
Ingres 10.0 build 104 2009-08-05 ingres_1000_build_104_alpha media:Test_Output_intlnx_1000_b104_2009-08-05.tar.gz
Ingres 10.0 build 103 2009-07-23 ingres_1000_build_103_alpha media:Test_Output_intlnx_1000_b103_2009-07-23.tar.gz
Ingres 9.4 build 102 2009-07-08 ingres_940_build_102_alpha media:Test_Output_intlnx_940_b102_2009-07-08.tar.gz
Ingres 9.4 build 101 2009-06-24 ingres_940_build_101_alpha media:Test_Output_intlnx_940_b101_2009-06-24.tar.gz
Ingres 9.4 build 100 2009-06-10 ingres_940_build_100_alpha media:Test_Output_intlnx_940_b100_2009-06-10.tar.gz
  • The release has been renamed from 9.4 to 10.0



Ingres 9.3 Test output archive files
Checkpoint Build Name Subversion Tag Output Archive File
Ingres 9.3 build 151 2009-05-21 ingres_930_build_151_alpha media:Test_Output_intlnx_930_b151_2009-05-21.tar.gz
Ingres 9.3 build 150 2009-05-13 ingres_930_build_150_alpha media:Test_Output_intlnx_930_b150_2009-05-13.tar.gz
Ingres 9.3 build 149 2009-04-29 ingres_930_build_149_alpha media:Test_Output_intlnx_930_b149_2009-04-29.tar.gz
Ingres 9.3 build 148 2009-04-15 ingres_930_build_148_alpha media:Test_Output_intlnx_930_b148_2009-04-15.tar.gz
Ingres 9.3 build 147 2009-04-01 ingres_930_build_147_alpha media:Test_Output_intlnx_930_b147_2009-04-01.tar.gz
Ingres 9.3 build 146 2009-03-18 ingres_930_build_146_alpha media:Test_Output_intlnx_930_b146_2009-03-18.tar.gz
Ingres 9.3 build 145 2009-03-11 ingres_930_build_145_alpha media:Test_Output_intlnx_930_b145_2009-03-11.tar.gz
Ingres 9.3 build 144 2009-02-25 ingres_930_build_144_alpha media:Test_Output_intlnx_930_b144_2009-02-25.tar.gz
Ingres 9.3 build 143 2009-02-11 ingres_930_build_143_alpha media:Test_Output_intlnx_930_b143_2009-02-11.tar.gz
Ingres 9.3 build 142 2009-01-28 ingres_930_build_142_alpha media:Test_Output_intlnx_930_b142_2009-01-28.tar.gz
  • Ingres 9.3 build 151 is the last Community build that will be made available for 9.3. The next Ingres 9.3 build will be a Commercial GA version.

Troubleshooting

My compile/install/test keeps stopping! What's wrong?

The hard drive or partition is full

"It's always a matter of space!" ~vande02

Especially if you're running in a VM, free up some space by deleting old junk or unused ingres instances.

Your computer was locked or went to sleep

Sometimes the script fails to recover from sleep mode, so make sure to disable that. It has also been reported that the (Fedora Core) screensaver lock interrupts script execution, so consider disabling it temporarily.

There's a bug

Yes, it happens. If the script consistently stops at the same place, where it had never stopped on previous code revisions, either rollback or wait for an update to a newer revision of source code.

Isolating Segmentation Violation Errors

If you notice any SEGV errors in 'errlog.log' (see reading output) after running the test suite, it may be necessary to track down the cause. The procedure for this is to compare the time the error occurred with the timestamps for the beginning of each test in the SEP output (*.out) files. Since there are a number of SEP output files, it can get tedious to search through them all manually. You can quickly find the necessary file with the following command: grep -lirc "Mon Oct 27 06:27" /ingres/install/T1/output/*

In this case, the error occurred at "Mon Oct 27 06:27:07 2008", but the search only compared up to minutes just in case there are any discrepancies. Open the file with your favourite text editor, and take note of which test (or series of tests if they have the same timestamp) that could possibly have caused the error.

Re-run each test individually (don't forget to set SEPPARAMDB!), until you are fairly certain which test is producing the SEGV. In a separate console, run "tail -f /ingres/install/T5/ingres/files/errlog.log", then continue with the test execution to see the SEGV happen in realtime.

If for any reason you want a complete list of all output files, you can find them with this command: find /ingres/install/T1/output -name "*.out" -type f

TODO

  • testing on Windows?
Personal tools
© 2011 Actian Corporation. All Rights Reserved