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

GH-524: Disable entry_dns #526

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions node/src/server_initializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use time::OffsetDateTime;
use tokio::prelude::{Async, Future};

pub struct ServerInitializerReal {
#[allow(dead_code)]
dns_socket_server: Box<dyn ConfiguredByPrivilege<Item = (), Error = ()>>,
bootstrapper: Box<dyn ConfiguredByPrivilege<Item = (), Error = ()>>,
privilege_dropper: Box<dyn PrivilegeDropper>,
Expand All @@ -42,12 +43,13 @@ impl ServerInitializer for ServerInitializerReal {
let data_directory = value_m!(multi_config, "data-directory", String)
.expect("ServerInitializer: Data directory not present in Multi Config");

// TODO: GH-525: This card should bring back the commented out code for dns_socket_server
let result: RunModeResult = Ok(())
.combine_results(
self.dns_socket_server
.as_mut()
.initialize_as_privileged(&multi_config),
)
// .combine_results(
// self.dns_socket_server
// .as_mut()
// .initialize_as_privileged(&multi_config),
// )
.combine_results(
self.bootstrapper
.as_mut()
Expand All @@ -60,11 +62,11 @@ impl ServerInitializer for ServerInitializerReal {
self.privilege_dropper.drop_privileges(&real_user);

result
.combine_results(
self.dns_socket_server
.as_mut()
.initialize_as_unprivileged(&multi_config, streams),
)
// .combine_results(
// self.dns_socket_server
// .as_mut()
// .initialize_as_unprivileged(&multi_config, streams),
// )
.combine_results(
self.bootstrapper
.as_mut()
Expand All @@ -79,11 +81,12 @@ impl Future for ServerInitializerReal {
type Error = ();

fn poll(&mut self) -> Result<Async<<Self as Future>::Item>, <Self as Future>::Error> {
try_ready!(self
.dns_socket_server
.as_mut()
.join(self.bootstrapper.as_mut())
.poll());
// try_ready!(self
// .dns_socket_server
// .as_mut()
// .join(self.bootstrapper.as_mut())
// .poll());
try_ready!(self.bootstrapper.as_mut().poll());
Ok(Async::Ready(()))
}
}
Expand Down Expand Up @@ -726,7 +729,8 @@ pub mod tests {
}

#[test]
#[should_panic(expected = "EntryDnsServerMock was instructed to panic")]
// TODO: GH-525: It should panic
// #[should_panic(expected = "EntryDnsServerMock was instructed to panic")]
fn server_initializer_dns_socket_server_panics() {
let bootstrapper = CrashTestDummy::new(CrashPoint::None, BootstrapperConfig::new());
let privilege_dropper = PrivilegeDropperMock::new();
Expand Down Expand Up @@ -840,8 +844,8 @@ pub mod tests {
[
bootstrapper_init_privileged_params_arc,
bootstrapper_init_unprivileged_params_arc,
dns_socket_server_privileged_params_arc,
dns_socket_server_unprivileged_params_arc,
// dns_socket_server_privileged_params_arc, // TODO: GH-525: Fix me
// dns_socket_server_unprivileged_params_arc,
]
.iter()
.for_each(|arc_params| {
Expand Down Expand Up @@ -889,12 +893,13 @@ pub mod tests {

let result = subject.go(&mut holder.streams(), &args);

// TODO: GH-525: Fix me
assert_eq!(
result,
Err(ConfiguratorError::new(vec![
ParamError::new("dns-iap", "dns-iap-reason"),
// ParamError::new("dns-iap", "dns-iap-reason"),
ParamError::new("boot-iap", "boot-iap-reason"),
ParamError::new("dns-iau", "dns-iau-reason"),
// ParamError::new("dns-iau", "dns-iau-reason"),
ParamError::new("boot-iau", "boot-iau-reason")
]))
);
Expand Down
4 changes: 4 additions & 0 deletions node/tests/dns_round_trip_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use trust_dns::op::{OpCode, ResponseCode};
use trust_dns::rr::{DNSClass, RecordType};

#[test]
// TODO This ignore should be lifted by GH-525
#[ignore]
#[serial(port53)]
fn handles_two_consecutive_ipv4_dns_requests_integration() {
let _node = utils::MASQNode::start_standard(
Expand All @@ -25,6 +27,8 @@ fn handles_two_consecutive_ipv4_dns_requests_integration() {
}

#[test]
// TODO This ignore should be lifted by GH-525
#[ignore]
#[serial(port53)]
fn handles_consecutive_heterogeneous_dns_requests_integration() {
let _node = utils::MASQNode::start_standard(
Expand Down
Loading