#[non_exhaustive]pub enum Injection {
Fault {
service: String,
action: String,
code: u16,
},
Delay(Duration),
DiscardWrites,
SideEffect {
service: String,
action: String,
variable: String,
value: String,
},
LockLogin,
Counter {
service: String,
variable: String,
step: u64,
wrap: Option<u64>,
},
Disconnect {
service: String,
action: String,
},
Truncate {
service: String,
action: String,
},
Reboot {
down: u32,
serial: Option<String>,
},
FailPage {
page: String,
field: String,
value: String,
},
}Expand description
A change to how the simulator behaves, until cleared.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Fault
Calls of an action fail with a UPnP error once their arguments are
valid. service is any reference Service::matches accepts, like
WLANConfiguration1.
Delay(Duration)
Every response is sent after a delay, to make clients time out.
DiscardWrites
Writes succeed, but change nothing.
SideEffect
A write of an action also sets a state variable of the same service, like a device that resets the settings of a feature when it is turned off. Discarded writes set nothing.
LockLogin
The account is locked: every login fails, even with the right password.
Counter
Every call of a getter that answers a state variable of a service
first adds step to it, like a counter of bytes, and wraps around
at wrap, or at 2^64 without it.
Disconnect
Calls of an action break off without an answer, like a connection that fails while the call is sent. The call changes nothing.
Truncate
Calls of an action answer with a body that ends early, like a connection that closes while the answer is sent. The call changes nothing.
Reboot
A call of Reboot of DeviceConfig1 restarts the device: it
answers the call, breaks off the next down requests without an
answer, and then answers again, with the uptime of DeviceInfo1
GetInfo reset to 0. With serial, another device comes back: it
answers this serial number.
FailPage
Posts of the page page of /data.lua whose form field field is
value fail with 500, after the page took the form, like a page
that remembers its filter but breaks off its answer.
Implementations§
Source§impl Injection
impl Injection
Sourcepub fn disconnect(service: impl Into<String>, action: impl Into<String>) -> Self
pub fn disconnect(service: impl Into<String>, action: impl Into<String>) -> Self
Calls of action of service break off without an answer.
Sourcepub fn truncate(service: impl Into<String>, action: impl Into<String>) -> Self
pub fn truncate(service: impl Into<String>, action: impl Into<String>) -> Self
Calls of action of service answer with a body that ends early.
Sourcepub fn reboot(down: u32) -> Self
pub fn reboot(down: u32) -> Self
A call of Reboot restarts the device, which breaks off the next
down requests.
Sourcepub fn fail_page(
page: impl Into<String>,
field: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn fail_page( page: impl Into<String>, field: impl Into<String>, value: impl Into<String>, ) -> Self
Posts of page with value in the form field field fail.
Sourcepub fn fault(
service: impl Into<String>,
action: impl Into<String>,
code: u16,
) -> Self
pub fn fault( service: impl Into<String>, action: impl Into<String>, code: u16, ) -> Self
Calls of action of service fail with the UPnP error code.