1. 14 Jul, 2016 1 commit
    • Thomas Markwalder's avatar
      [4277] Addressed bulk of review comments · 15b51b62
      Thomas Markwalder authored
      src/lib/dhcpsrv/tests/pgsql_exchange_unittest.cc
          - Added PgSqlBasicsTest test fixture class and tests which exercise all of
          the PostgreSQL data types we currently use with round-trip database writes
          and reads
      
      src/lib/dhcpsrv/pgsql_connection.cc
      src/lib/dhcpsrv/pgsql_connection.h
          - Moved PgSqlResult function impls from .h
          - Added exception safe implementation of getColumnLabel() to PgSqlResult
      
      src/lib/dhcpsrv/pgsql_exchange.cc
      src/lib/dhcpsrv/pgsql_exchange.h
          - PsqlBindArray::add() variants which accept raw pointers now throw
          if the pointer is NULL
          - PgSqlExchange::getColumnLabel() is now a wrapper around PgSqlResult method
      
      src/lib/dhcpsrv/pgsql_host_data_source.h
      src/lib/dhcpsrv/pgsql_host_data_source.cc
           - Commentary clean up
      
      src/lib/dhcpsrv/pgsql_lease_mgr.cc
           - Commentary clean up
      15b51b62
  2. 27 Jun, 2016 1 commit
  3. 24 Jun, 2016 5 commits
    • Thomas Markwalder's avatar
      [4277] Fixed PsqlBindArray.basicOperation unit test · 3466f650
      Thomas Markwalder authored
      Fixed test now that PsqlBindArray.toText() works right.
      3466f650
    • Thomas Markwalder's avatar
      0ce4fe5b
    • Thomas Markwalder's avatar
      [4277] Rollback test passes · 3c221983
      Thomas Markwalder authored
      tests/pgsql_host_data_source_unittest.cc
          TEST_F(PgSqlHostDataSourceTest, testAddRollback) now
          functions and passes
      3c221983
    • Thomas Markwalder's avatar
      [4277] IPv6 Reservations now functional · 8f21305b
      Thomas Markwalder authored
      src/lib/dhcpsrv/pgsql_exchange.h
      src/lib/dhcpsrv/pgsql_exchange.cc
      src/lib/dhcpsrv/pgsql_lease_mgr.cc
          Moved getIPv6Value() from PgSqlLease6Exchange to
          PgSqlExchange and made it static
      
          PgSqlExchange::dumpRow() gets number of columns
          from result set, not parameter
      
      src/lib/dhcpsrv/pgsql_host_data_source.cc
           PgSqlIPv6ReservationExchange
           PgSqlHostIPv6Exchange - now functional
      
      src/lib/dhcpsrv/tests/pgsql_host_data_source_unittest.cc
          TEST_F(PgSqlHostDataSourceTest, get6AddrWithDuid)
          TEST_F(PgSqlHostDataSourceTest, addDuplicate6WithHWAddr)
          TEST_F(PgSqlHostDataSourceTest, optionsReservations6)
          TEST_F(PgSqlHostDataSourceTest, optionsReservations46)
          TEST_F(PgSqlHostDataSourceTest, formattedOptionsReservations6)
          TEST_F(PgSqlHostDataSourceTest, formattedOptionsReservations46)
          - All included and passing.
      8f21305b
    • Thomas Markwalder's avatar
      [4277] PgSqlHostWithOptionsExchange, PgSqlOptionExchange now functional · 3c01633e
      Thomas Markwalder authored
      src/lib/dhcpsrv/pgsql_connection.h
          Added OID_TEXT
      
      src/lib/dhcpsrv/pgsql_exchange.cc
          PsqlBindArray::addNull()
      
          class PgSqlExchange
              - getColumnLabel() - now gets column name from result set
              - getColumnValue variants are now static methods
              - rename column_labels_ to columns_
              - isColumnNull() new method tests if column in row is null
              - dumpRow() - debug method dumps row as text
      
      src/lib/dhcpsrv/pgsql_host_data_source.cc
          PgSqlHostWithOptionsExchange
          PgSqlOptionExchange  now functional
      
      src/lib/dhcpsrv/tests/pgsql_host_data_source_unittest.cc
          TEST_F(PgSqlHostDataSourceTest, addDuplicate4)
          TEST_F(PgSqlHostDataSourceTest, formattedOptionsReservations4)
          - Enabled and passing.
      3c01633e
  4. 22 Jun, 2016 2 commits
  5. 21 Jun, 2016 4 commits
    • Thomas Markwalder's avatar
      [4277] Bare bones implementation of PgSqlHostDataSource · 33428957
      Thomas Markwalder authored
      src/lib/dhcpsrv
          pgsql_host_data_source.c
          pgsql_host_data_source.h  - new files, preliminary implementation
      
      src/lib/dhcpsrv/Makefile.am
          Added new files pgsql_host_data_source.cc, pgsql_host_data_source.h
      
      src/lib/dhcpsrv/dhcpsrv_messages.mes
          Added log messages DHCPSRV_PGSQL_HOST_DB_GET_VERSION, DHCPSRV_PGSQL_START_TRANSACTION
      
      src/lib/dhcpsrv/pgsql_connection.cc
      src/lib/dhcpsrv/pgsql_connection.h
          Added PgSqlTransaction
          Added PgSqlConnection::startTransaction()
      
      src/lib/dhcpsrv/pgsql_exchange.cc
      src/lib/dhcpsrv/pgsql_exchange.h
          PsqlBindArray
          - Added storage of conversion strings used for bound values
          - Added add() variants for uint8_t, IOAddress, uint8_t buffer
          - Added templated variant for miscellaneous types
      
          PgSqlExchange
          - Removed getColumnValue variants for various integers, replaced
          with templated version for miscellaneous types
      
      src/lib/dhcpsrv/pgsql_lease_mgr.cc
          Added todo comment to remember to account for hwaddr columns added to lease6
      
      src/lib/dhcpsrv/tests/pgsql_exchange_unittest.cc
          TEST(PsqlBindArray, basicOperation) - new test to exercise bind functions
      33428957
    • Thomas Markwalder's avatar
      f15c1a11
    • Thomas Markwalder's avatar
      [master] PostgreSQL schema 3.0, support for host reservations · 6f8e646b
      Thomas Markwalder authored
          Merges in branch 'trac4275'
      6f8e646b
    • Thomas Markwalder's avatar
      [4275] Addressed review comments · 0433e62c
      Thomas Markwalder authored
      bin/admin/tests/pgsql_tests.sh.in
          Typos
      share/database/scripts/pgsql/.gitignore
          Added upgrade_2.0_to_3.0.sh
      
      share/database/scripts/pgsql/dhcpdb_create.pgsql
          Added entry for client_id to hosts_identifier
          Added commentrary for dhcp_option_scope
          Added periods to the ends of sentences.
      0433e62c
  6. 16 Jun, 2016 5 commits
  7. 15 Jun, 2016 3 commits
    • Thomas Markwalder's avatar
      [4275] Postgresql schema 3.0 now matches MySql schema 4.2 · a7db3554
      Thomas Markwalder authored
      Added 4.1 to 4.2 updates from MySQL and created upgrade
      script for 2.0 to 3.0
      
      src/share/database/scripts/pgsql/dhcpdb_create.pgsql
          - Enclosed the entire script in a single transaction
          - Removed DROP TABLE statements
          - Added host_identifier_type table and data
          - Added dhcp_option_scope table and data
          - Updated unqiue constraints for hosts table
          - Added scope_id and foreign key constraint to dhcp4_options table
          - Added scope_id and foreign key constraint to dhcp6_options table
          - Added unique contraint to ipv6_reservations table
          - Changed 'HWADDR_SOURCE_DOCSIS' to 'HWADDR_SOURCE_DOCSIS_CMTS'
          - Inserted row for 'HWADDR_SOURCE_UKNOWN'
      
      src/share/database/scripts/pgsql/dhcpdb_drop.pgsql
          Added drops for host_identifier_type and  dhcp_option_scope
      
      src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in
          New file for upgrading Postgresql from 2.0 to 3.0
      
      configure.ac
          Added src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh
      
      src/bin/admin/tests/pgsql_tests.sh.in
          - pgsql_upgrade_1_0_to_2_0 - new function which contains all the checks used
          to verify 1.0 to 2.0 upgrade (extracted from pgsql_upgrade_test)
          - pgsql_upgrade_2_0_to_3_0 - new function which contains all the checks used
          to verify 2.0 to 3.0 upgrade
          - pgsql_upgrade_test() - modified use new upgrade check fucntions
      
      src/share/database/scripts/pgsql/Makefile.am
          Added entry for upgrade_2.0_to_3.0.sh
      a7db3554
    • Francis Dupont's avatar
      [4106_update] Addressed comments · 2af3e843
      Francis Dupont authored
      2af3e843
    • Francis Dupont's avatar
      [master] Updated licence · 7299124a
      Francis Dupont authored
      7299124a
  8. 14 Jun, 2016 3 commits
    • Thomas Markwalder's avatar
      [4275] Brought Postgresql schema up to MySQL 4.1 content · 67e12a02
      Thomas Markwalder authored
      Postresql schema now supports host reservations with options,
      and lease6 table now includes hardware address and source
      
      src/share/database/scripts/pgsql/dhcpdb_create.pgsql
          Added Schema 3.0 upgrade section:
          - new tables: hosts, dhcp4_options, dhcp6_options,
            ipv6_reservations, lease_hwaddr_source
      
          - lease4Dumpdata() - results now sorted by lease address
      
          - lease6 table - added columns hwaddr, hwtype, hwaddr_source
      
          - lease6DumpHeader() - added labels for new columns
          - lease6DumpData() - added new columns, results now sorted by
            lease address
      
          - schema_vesion - bumped version to 3
      
      src/share/database/scripts/pgsql/dhcpdb_drop.pgsql
          Added drops of new tables
      
      src/lib/dhcpsrv/pgsql_lease_mgr.cc
          - PgSqlLeaseMgr::PgSqlLeaseMgr() - added logic to detect schema
          mismatch between the code and configured database
      
      src/lib/dhcpsrv/pgsql_lease_mgr.h
          - Bumped PG_CURRENT_VERSION from 2 to 3
      
      src/bin/admin/tests/data/pgsql.lease6_dump_test.reference.csv
          - Reordered entries to account for dump function sort order
          - Added values for new columns on lease6 table
      
      src/bin/admin/tests/pgsql_tests.sh.in
          - pgsql_lease_version_test() - changed expected version to 3.0
          - pgsql_lease6_dump_test() - added new column values to inserted rows
      67e12a02
    • Marcin Siodelski's avatar
      2ac1a5f0
    • Marcin Siodelski's avatar
      [master] Merge branch 'trac3573' · c29551e4
      Marcin Siodelski authored
      c29551e4
  9. 13 Jun, 2016 4 commits
  10. 10 Jun, 2016 4 commits
  11. 09 Jun, 2016 7 commits
  12. 08 Jun, 2016 1 commit