]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/tools/cats_test.c
Change copyright as per agreement with FSFE + update copyright year
[bacula/bacula] / bacula / src / tools / cats_test.c
index c134b7cc2c79bd6f57ff0456dd7514938b328cca..75adc4d303a0d0e486f1df9e6bc657a9540369fa 100644 (file)
@@ -1,29 +1,20 @@
 /*
-   Bacula® - The Network Backup Solution
-
-   Copyright (C) 2011-2011 Free Software Foundation Europe e.V.
-
-   The main author of Bacula is Kern Sibbald, with contributions from
-   many others, a complete list can be found in the file AUTHORS.
-   This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version three of the GNU Affero General Public
-   License as published by the Free Software Foundation and included
-   in the file LICENSE.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU Affero General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.
-
-   Bacula® is a registered trademark of Kern Sibbald.
-   The licensor of Bacula is the Free Software Foundation Europe
-   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
-   Switzerland, email:ftf@fsfeurope.org.
+   Bacula(R) - The Network Backup Solution
+
+   Copyright (C) 2000-2016 Kern Sibbald
+
+   The original author of Bacula is Kern Sibbald, with contributions
+   from many others, a complete list can be found in the file AUTHORS.
+
+   You may use this file and others of this release according to the
+   license defined in the LICENSE file, which includes the Affero General
+   Public License, v3.0 ("AGPLv3") and some additional permissions and
+   terms pursuant to its AGPLv3 Section 7.
+
+   This notice must be preserved when any source code is 
+   conveyed and/or propagated.
+
+   Bacula(R) is a registered trademark of Kern Sibbald.
 */
 /*
  *  Program to test CATS DB routines
 
 #include "bacula.h"
 #include "cats/cats.h"
-#include "cats/bdb_priv.h"
-#include "cats/sql_glue.h"
 #include "cats/bvfs.h"
 #include "findlib/find.h"
  
 /* Local variables */
-static B_DB *db;
+static BDB *db;
 static const char *file = "COPYRIGHT";
 //static DBId_t fnid=0;
 static const char *db_name = "bacula";
@@ -57,7 +46,7 @@ static void usage()
 {
    fprintf(stderr, _(
 PROG_COPYRIGHT
-"\nVersion: %s (%s)\n"
+"\n%sVersion: %s (%s)\n"
 "       -d <nn>           set debug level to <nn>\n"
 "       -dt               print timestamp in debug output\n"
 "       -n <name>         specify the database name (default bacula)\n"
@@ -70,7 +59,7 @@ PROG_COPYRIGHT
 "       -l <limit>        maximum tuple to fetch\n"
 "       -q                print only errors\n"
 "       -v                verbose\n"
-"       -?                print this message\n\n"), 2011, VERSION, BDATE);
+"       -?                print this message\n\n"), 2011, BDEMO, VERSION, BDATE);
    exit(1);
 }
 
@@ -335,8 +324,8 @@ int main (int argc, char *argv[])
     */
 
    jcr = new_jcr(sizeof(JCR), NULL);
-   jcr->set_JobType(JT_CONSOLE);
-   jcr->set_JobLevel(L_NONE);
+   jcr->setJobType(JT_CONSOLE); 
+   jcr->setJobLevel(L_NONE); 
    jcr->JobStatus = JS_Running;
    bstrncpy(jcr->Job, "**dummy**", sizeof(jcr->Job));
    jcr->JobId = pid;      /* this is JobId on tape */
@@ -350,6 +339,8 @@ int main (int argc, char *argv[])
                    NULL /* dbi driver */,
                    db_name, db_user, db_password, db_address, db_port + 100,
                    NULL /* db_socket */,
+                   db_ssl_key, db_ssl_cert, db_ssl_ca,
+                   db_ssl_capath, db_ssl_cipher,
                    0 /* mult_db_connections */, false);
       ok(db != NULL, "Test bad connection");
       if (!db) {
@@ -364,6 +355,8 @@ int main (int argc, char *argv[])
                 NULL /* dbi driver */,
                 db_name, db_user, db_password, db_address, db_port,
                 NULL /* db_socket */,
+                db_ssl_key, db_ssl_cert, db_ssl_ca,
+                db_ssl_capath, db_ssl_cipher,
                 false /* mult_db_connections */, false);
 
    ok(db != NULL, "Test db connection");
@@ -384,7 +377,6 @@ int main (int argc, char *argv[])
 
 
    /* Check if the SQL library is thread-safe */
-   //db_check_backend_thread_safe();
    ok(check_tables_version(jcr, db), "Check table version");
    ok(db_sql_query(db, "SELECT VersionId FROM Version", 
                    db_int_handler, &j), "SELECT VersionId");
@@ -631,7 +623,7 @@ int main (int argc, char *argv[])
 
    Pmsg0(0, "Search pool by PoolId\n");
    nok(db_create_pool_record(jcr, db, &pr),"Can't create pool twice");
-   ok(db_get_pool_record(jcr, db, &pr2), "Search pool by PoolId");
+   ok(db_get_pool_numvols(jcr, db, &pr2), "Search pool by PoolId");
    cmp_pool(pr, pr2);
 
    pr2.MaxVols++;
@@ -651,7 +643,7 @@ int main (int argc, char *argv[])
    ok(db_update_pool_record(jcr, db, &pr2), "Update Pool record");
    memset(&pr, 0, sizeof(pr));
    pr.PoolId = pr2.PoolId;
-   ok(db_get_pool_record(jcr, db, &pr), "Search pool by PoolId");
+   ok(db_get_pool_numvols(jcr, db, &pr), "Search pool by PoolId");
    cmp_pool(pr, pr2);
 
    ok(db_delete_pool_record(jcr, db, &pr), "Delete Pool");