Skip to content

Commit 32d60ec

Browse files
committed
chore: M5 CI/Workflow Sweep - final synchronisation
1 parent b5a7fa8 commit 32d60ec

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

crates/hesiod-lib/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ mod tests {
101101
"lhs": ".ns",
102102
"rhs": ".example.internal"
103103
}"#;
104-
let config = HesiodConfig::from_json(json).unwrap();
104+
let config = HesiodConfig::from_json(json).expect("TODO: handle error");
105105
assert_eq!(config.domain, "example.internal");
106106
assert_eq!(config.ttl, 300);
107107
assert_eq!(config.dns_port, 53);
@@ -127,7 +127,7 @@ mod tests {
127127
{"name": "ops", "gid": 1001, "members": ["admin"]}
128128
]
129129
}"#;
130-
let config = HesiodConfig::from_json(json).unwrap();
130+
let config = HesiodConfig::from_json(json).expect("TODO: handle error");
131131
assert_eq!(config.ttl, 600);
132132
assert_eq!(config.services.len(), 1);
133133
assert_eq!(config.users.len(), 1);

crates/hesiod-lib/src/records.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ mod tests {
308308
txt,
309309
"admin:*:1000:1000:FlatRacoon Admin:/home/admin:/bin/bash"
310310
);
311-
let parsed = PasswdRecord::from_txt(&txt).unwrap();
311+
let parsed = PasswdRecord::from_txt(&txt).expect("TODO: handle error");
312312
assert_eq!(record, parsed);
313313
}
314314

@@ -321,7 +321,7 @@ mod tests {
321321
};
322322
let txt = record.to_txt();
323323
assert_eq!(txt, "operators:*:1001:admin,operator");
324-
let parsed = GroupRecord::from_txt(&txt).unwrap();
324+
let parsed = GroupRecord::from_txt(&txt).expect("TODO: handle error");
325325
assert_eq!(record, parsed);
326326
}
327327

@@ -334,7 +334,7 @@ mod tests {
334334
};
335335
let txt = record.to_txt();
336336
assert_eq!(txt, "empty:*:9999:");
337-
let parsed = GroupRecord::from_txt(&txt).unwrap();
337+
let parsed = GroupRecord::from_txt(&txt).expect("TODO: handle error");
338338
assert_eq!(parsed.members, Vec::<String>::new());
339339
}
340340

@@ -347,7 +347,7 @@ mod tests {
347347
};
348348
let txt = record.to_txt();
349349
assert_eq!(txt, "twingate.svc:443:tcp");
350-
let parsed = ServiceRecord::from_txt(&txt).unwrap();
350+
let parsed = ServiceRecord::from_txt(&txt).expect("TODO: handle error");
351351
assert_eq!(record, parsed);
352352
}
353353

@@ -361,7 +361,7 @@ mod tests {
361361
};
362362
let txt = record.to_txt();
363363
assert_eq!(txt, "nfs /home nfsserver:/export rw");
364-
let parsed = FilsysRecord::from_txt(&txt).unwrap();
364+
let parsed = FilsysRecord::from_txt(&txt).expect("TODO: handle error");
365365
assert_eq!(record, parsed);
366366
}
367367

@@ -373,14 +373,14 @@ mod tests {
373373
protocol: "tcp".into(),
374374
});
375375
let txt = record.to_txt();
376-
let parsed = HesiodRecord::from_txt(MapType::Service, &txt).unwrap();
376+
let parsed = HesiodRecord::from_txt(MapType::Service, &txt).expect("TODO: handle error");
377377
assert_eq!(record, parsed);
378378
}
379379

380380
#[test]
381381
fn map_type_parse() {
382-
assert_eq!("passwd".parse::<MapType>().unwrap(), MapType::Passwd);
383-
assert_eq!("GROUP".parse::<MapType>().unwrap(), MapType::Group);
382+
assert_eq!("passwd".parse::<MapType>().expect("TODO: handle error"), MapType::Passwd);
383+
assert_eq!("GROUP".parse::<MapType>().expect("TODO: handle error"), MapType::Group);
384384
assert!("bogus".parse::<MapType>().is_err());
385385
}
386386
}

crates/hesiod-lib/src/server.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,28 +176,28 @@ mod tests {
176176
users: vec![],
177177
groups: vec![],
178178
};
179-
HesiodZone::from_config(&config).unwrap()
179+
HesiodZone::from_config(&config).expect("TODO: handle error")
180180
}
181181

182182
#[test]
183183
fn resolve_service_name() {
184184
let zone = test_zone();
185-
let name: Name = "web.service.ns.test.internal".parse().unwrap();
185+
let name: Name = "web.service.ns.test.internal".parse().expect("TODO: handle error");
186186
let result = resolve_name(&name, &zone);
187187
assert_eq!(result, Some("web.svc:443:tcp".into()));
188188
}
189189

190190
#[test]
191191
fn resolve_missing_name() {
192192
let zone = test_zone();
193-
let name: Name = "missing.service.ns.test.internal".parse().unwrap();
193+
let name: Name = "missing.service.ns.test.internal".parse().expect("TODO: handle error");
194194
assert!(resolve_name(&name, &zone).is_none());
195195
}
196196

197197
#[test]
198198
fn resolve_wrong_suffix() {
199199
let zone = test_zone();
200-
let name: Name = "web.service.ns.other.internal".parse().unwrap();
200+
let name: Name = "web.service.ns.other.internal".parse().expect("TODO: handle error");
201201
assert!(resolve_name(&name, &zone).is_none());
202202
}
203203
}

crates/hesiod-lib/src/zone.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,19 @@ mod tests {
200200
#[test]
201201
fn zone_from_config() {
202202
let config = sample_config();
203-
let zone = HesiodZone::from_config(&config).unwrap();
203+
let zone = HesiodZone::from_config(&config).expect("TODO: handle error");
204204
assert_eq!(zone.record_count(), 3);
205205
}
206206

207207
#[test]
208208
fn zone_lookup() {
209209
let config = sample_config();
210-
let zone = HesiodZone::from_config(&config).unwrap();
210+
let zone = HesiodZone::from_config(&config).expect("TODO: handle error");
211211

212-
let svc = zone.lookup("web", MapType::Service).unwrap();
212+
let svc = zone.lookup("web", MapType::Service).expect("TODO: handle error");
213213
assert_eq!(svc.to_txt(), "web.svc:443:tcp");
214214

215-
let user = zone.lookup("admin", MapType::Passwd).unwrap();
215+
let user = zone.lookup("admin", MapType::Passwd).expect("TODO: handle error");
216216
assert!(user.to_txt().starts_with("admin:*:1000"));
217217

218218
assert!(zone.lookup("nonexistent", MapType::Passwd).is_none());
@@ -221,7 +221,7 @@ mod tests {
221221
#[test]
222222
fn zone_bind_output() {
223223
let config = sample_config();
224-
let zone = HesiodZone::from_config(&config).unwrap();
224+
let zone = HesiodZone::from_config(&config).expect("TODO: handle error");
225225
let bind = zone.to_bind_zone();
226226

227227
assert!(bind.contains("$ORIGIN .test.internal."));
@@ -243,7 +243,7 @@ mod tests {
243243
mode: "rw".into(),
244244
}),
245245
);
246-
let rec = zone.lookup("home", MapType::Filsys).unwrap();
246+
let rec = zone.lookup("home", MapType::Filsys).expect("TODO: handle error");
247247
assert_eq!(rec.to_txt(), "nfs /home nfs:/export rw");
248248
}
249249
}

0 commit comments

Comments
 (0)