Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/franku/master/sql find #361

Merged
merged 9 commits into from Dec 14, 2019
Merged

dev/franku/master/sql find #361

merged 9 commits into from Dec 14, 2019

Conversation

franku
Copy link
Contributor

@franku franku commented Dec 5, 2019

This PR adds a systemtest (and a unittest) for the database request function BareosDb::FindLastJobStartTimeForJobAndClient().

The systemtest itself prepares the database like all other systemtests and then calls the unittest which in turn will execute insert statements to prepare the data. After that the request function will be called to retrieve the data from the database. The test checks the data for correctness.

The alist* bakend_dirs was replaced by a std::vector because this makes it easier to provide the data.

The output data from FindLastJobStartTimeForJobAndClient will be returned into a std::vector instead of poolmem.

CFG_TYPE_STR_VECTOR_OF_DIRS was introduced as a new config parameter type, because this type will be mapped to "DIRECTORY_LIST" especially for documentation.

This PR also fixes the directory name of another test (run-on-client-connect-interval)

There was a new return code introduced: BareosDb::SqlFindResult which lets the programm distinguish if the db request failed, succeeded or the result set is empty.

@franku franku requested a review from arogge December 5, 2019 12:52
@franku franku force-pushed the dev/franku/master/sql-find branch 2 times, most recently from f551282 to 472d2d6 Compare December 9, 2019 12:20
@franku franku requested review from pstorz and removed request for arogge December 9, 2019 12:27
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

- before, backend directories were stored in an alist containing pointers to c-strings
- store (default) parameter for directories in a std::vector
- the vector will be moved to the desination after config parser finishes
- tests: add catalog unittest and systemtest
- do not run the catalog unittest with 'make test' or 'ctest'
- the catalog-'unittest' will be run from the catalog-'systemtest'
- fixed: systemtests now delete the database and drop all tables before continuing
- add insert statements for job and client table
- use std::vector& for the result output buffer
- the testrunner of the catalog systemtest clears the database and then calls
  the catalog unittest
- correct paths to database cleanup scripts
- build catalog unittest using the new cmake macro
- improve catalog systemtest for sqlite3
@franku franku merged commit ab2c85f into master Dec 14, 2019
@franku franku deleted the dev/franku/master/sql-find branch December 14, 2019 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants