mirror of
https://github.com/ostreedev/ostree.git
synced 2025-02-02 13:47:38 +03:00
tests/inst: cargo fmt
This commit is contained in:
parent
92e2bc397b
commit
c52a2ff52e
@ -108,21 +108,22 @@ impl RebootMark {
|
||||
strategy: &InterruptStrategy,
|
||||
) -> &mut BTreeMap<UpdateResult, u32> {
|
||||
match strategy {
|
||||
InterruptStrategy::Polite(t) => self
|
||||
.polite
|
||||
.entry(t.clone())
|
||||
.or_insert_with(BTreeMap::new),
|
||||
InterruptStrategy::Force(t) => self
|
||||
.force
|
||||
.entry(t.clone())
|
||||
.or_insert_with(BTreeMap::new),
|
||||
InterruptStrategy::Polite(t) => {
|
||||
self.polite.entry(t.clone()).or_insert_with(BTreeMap::new)
|
||||
}
|
||||
InterruptStrategy::Force(t) => {
|
||||
self.force.entry(t.clone()).or_insert_with(BTreeMap::new)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl InterruptStrategy {
|
||||
pub(crate) fn is_noop(&self) -> bool {
|
||||
matches!(self, InterruptStrategy::Polite(PoliteInterruptStrategy::None))
|
||||
matches!(
|
||||
self,
|
||||
InterruptStrategy::Polite(PoliteInterruptStrategy::None)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -598,9 +599,7 @@ fn transactionality() -> Result<()> {
|
||||
upgrade_and_finalize().context("Firstrun upgrade failed")?;
|
||||
let end = time::Instant::now();
|
||||
let cycle_time = end.duration_since(start);
|
||||
let tdata = TransactionalTestInfo {
|
||||
cycle_time,
|
||||
};
|
||||
let tdata = TransactionalTestInfo { cycle_time };
|
||||
let mut f = std::io::BufWriter::new(std::fs::File::create(&TDATAPATH)?);
|
||||
serde_json::to_writer(&mut f, &tdata)?;
|
||||
f.flush()?;
|
||||
|
@ -82,7 +82,7 @@ pub(crate) const TEST_HTTP_BASIC_AUTH: &str = "foouser:barpw";
|
||||
fn validate_authz(value: &[u8]) -> Result<bool> {
|
||||
let buf = std::str::from_utf8(&value)?;
|
||||
if let Some(o) = buf.find("Basic ") {
|
||||
let (_, buf) = buf.split_at(o + "Basic ".len());
|
||||
let (_, buf) = buf.split_at(o + "Basic ".len());
|
||||
let buf = base64::decode(buf).context("decoding")?;
|
||||
let buf = std::str::from_utf8(&buf)?;
|
||||
Ok(buf == TEST_HTTP_BASIC_AUTH)
|
||||
|
Loading…
x
Reference in New Issue
Block a user