Files
hickory-dns/crates/server/tests/store_sqlite_tests.rs
Benjamin Fry 408d0baca0 Prepare 0.24 release with branding change to Hickory DNS (#2054)
* update all READMEs with notices about the name change

* update changelog for 0.24

* bump crate versions to 0.24

* update version notice information

* update readmes to back reference trust-dns

* rename all crates to hickory counterparts

* replace all Trust-DNS references in code and comments with Hickory DNS

* rename all Trust-DNS references to Hickory DNS in non-code

* rename all trust-dns-resolver references to hickory-resolver

* rename all trust-dns-client references to hickory-client

* rename all trust-dns-proto references to hickory-proto

* rename all trust-dns-server references to hickory-server

* rename all trust-dns-compatibility references to hickory-compatability

* rename all trust-dns-integration references to hickory-integration

* rename all trust-dns-util references to hickory-util

* Update MIT licenses to reference Hickory DNS

* update all trust-dns references to hickory-dns

* update all bluejekyll github references to hickorydns org

* Update name in Changelog

* make sure hickory-dns logs during tests

* add changelogs for recent main additions

* fix references to trust-dns and hickory in architecture

* update a few trust-dns references in READMEs

* fixup some dangling trust_dns references

* replace fka with formerly in change log

* replace all hickoydns org references to hickory-dns

* replace all http links with https

* update logos

* update hickorydns to hickory-dns for all other org references

* fix Notices of Trust-DNS to Hickory in each Readme
2023-10-13 18:39:28 -07:00

78 lines
2.0 KiB
Rust

#![cfg(feature = "sqlite")]
use std::fs;
use std::path::PathBuf;
use std::str::FromStr;
use futures_executor::block_on;
use hickory_proto::rr::Name;
use hickory_server::{
authority::ZoneType,
store::sqlite::{SqliteAuthority, SqliteConfig},
};
#[macro_use]
mod authority_battery;
fn sqlite(master_file_path: &str, module: &str, test_name: &str) -> SqliteAuthority {
let journal_path = PathBuf::from("target/tests")
.join(module.replace("::", "_"))
.join(test_name)
.join("authority_battery.jrnl");
fs::create_dir_all(journal_path.parent().unwrap()).ok();
// cleanup anything from previous test
fs::remove_file(&journal_path).ok();
let config = SqliteConfig {
zone_file_path: master_file_path.to_string(),
journal_file_path: journal_path.to_str().unwrap().to_string(),
allow_update: true,
};
block_on(SqliteAuthority::try_from_config(
Name::from_str("example.com.").unwrap(),
ZoneType::Primary,
false,
true,
None,
&config,
))
.expect("failed to load file")
}
#[allow(unused)]
fn sqlite_update(master_file_path: &str, module: &str, test_name: &str) -> SqliteAuthority {
let journal_path = PathBuf::from("target/tests")
.join(module.replace("::", "_"))
.join(test_name)
.join("authority_battery.jrnl");
fs::create_dir_all(journal_path.parent().unwrap()).ok();
// cleanup anything from previous test
fs::remove_file(&journal_path).ok();
let config = SqliteConfig {
zone_file_path: master_file_path.to_string(),
journal_file_path: journal_path.to_str().unwrap().to_string(),
allow_update: true,
};
block_on(SqliteAuthority::try_from_config(
Name::from_str("example.com.").unwrap(),
ZoneType::Primary,
false,
true,
None,
&config,
))
.expect("failed to load file")
}
basic_battery!(sqlite);
#[cfg(feature = "dnssec")]
dnssec_battery!(sqlite);
#[cfg(feature = "dnssec")]
dynamic_update!(sqlite_update);