| 1 |
#[test] |
| 2 |
fn selinux() { |
| 3 |
let path = super::selinux().unwrap(); |
| 4 |
assert!(!path.as_os_str().is_empty()); |
| 5 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 6 |
} |
| 7 |
|
| 8 |
#[test] |
| 9 |
fn default_type_path() { |
| 10 |
let path = super::default_type_path().unwrap(); |
| 11 |
assert!(!path.as_os_str().is_empty()); |
| 12 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 13 |
} |
| 14 |
|
| 15 |
#[test] |
| 16 |
fn fail_safe_context() { |
| 17 |
let path = super::fail_safe_context().unwrap(); |
| 18 |
assert!(!path.as_os_str().is_empty()); |
| 19 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 20 |
} |
| 21 |
|
| 22 |
#[test] |
| 23 |
fn removable_context() { |
| 24 |
let path = super::removable_context().unwrap(); |
| 25 |
assert!(!path.as_os_str().is_empty()); |
| 26 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 27 |
} |
| 28 |
|
| 29 |
#[test] |
| 30 |
fn default_context() { |
| 31 |
let path = super::default_context().unwrap(); |
| 32 |
assert!(!path.as_os_str().is_empty()); |
| 33 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 34 |
} |
| 35 |
|
| 36 |
#[test] |
| 37 |
fn user_contexts() { |
| 38 |
let path = super::user_contexts().unwrap(); |
| 39 |
assert!(!path.as_os_str().is_empty()); |
| 40 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 41 |
} |
| 42 |
|
| 43 |
#[test] |
| 44 |
fn file_context() { |
| 45 |
let path = super::file_context().unwrap(); |
| 46 |
assert!(!path.as_os_str().is_empty()); |
| 47 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 48 |
} |
| 49 |
|
| 50 |
#[test] |
| 51 |
fn file_context_homedir() { |
| 52 |
let path = super::file_context_homedir().unwrap(); |
| 53 |
assert!(!path.as_os_str().is_empty()); |
| 54 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 55 |
} |
| 56 |
|
| 57 |
#[test] |
| 58 |
fn file_context_local() { |
| 59 |
let path = super::file_context_local().unwrap(); |
| 60 |
assert!(!path.as_os_str().is_empty()); |
| 61 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 62 |
} |
| 63 |
|
| 64 |
#[test] |
| 65 |
fn file_context_subs() { |
| 66 |
let path = super::file_context_subs().unwrap(); |
| 67 |
assert!(!path.as_os_str().is_empty()); |
| 68 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 69 |
} |
| 70 |
|
| 71 |
#[test] |
| 72 |
fn file_context_subs_dist() { |
| 73 |
let path = super::file_context_subs_dist().unwrap(); |
| 74 |
assert!(!path.as_os_str().is_empty()); |
| 75 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 76 |
} |
| 77 |
|
| 78 |
#[test] |
| 79 |
fn home_dir_context() { |
| 80 |
let path = super::home_dir_context().unwrap(); |
| 81 |
assert!(!path.as_os_str().is_empty()); |
| 82 |
//assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 83 |
} |
| 84 |
|
| 85 |
#[test] |
| 86 |
fn media_context() { |
| 87 |
let path = super::media_context().unwrap(); |
| 88 |
assert!(!path.as_os_str().is_empty()); |
| 89 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 90 |
} |
| 91 |
|
| 92 |
#[test] |
| 93 |
fn virtual_domain_context() { |
| 94 |
let path = super::virtual_domain_context().unwrap(); |
| 95 |
assert!(!path.as_os_str().is_empty()); |
| 96 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 97 |
} |
| 98 |
|
| 99 |
#[test] |
| 100 |
fn virtual_image_context() { |
| 101 |
let path = super::virtual_image_context().unwrap(); |
| 102 |
assert!(!path.as_os_str().is_empty()); |
| 103 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 104 |
} |
| 105 |
|
| 106 |
#[test] |
| 107 |
fn lxc_contexts() { |
| 108 |
let path = super::lxc_contexts().unwrap(); |
| 109 |
assert!(!path.as_os_str().is_empty()); |
| 110 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 111 |
} |
| 112 |
|
| 113 |
#[test] |
| 114 |
fn x_context() { |
| 115 |
let path = super::x_context().unwrap(); |
| 116 |
assert!(!path.as_os_str().is_empty()); |
| 117 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 118 |
} |
| 119 |
|
| 120 |
#[test] |
| 121 |
fn sepgsql_context() { |
| 122 |
let path = super::sepgsql_context().unwrap(); |
| 123 |
assert!(!path.as_os_str().is_empty()); |
| 124 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 125 |
} |
| 126 |
|
| 127 |
#[test] |
| 128 |
fn openrc_contexts() { |
| 129 |
let path = super::openrc_contexts().unwrap(); |
| 130 |
assert!(!path.as_os_str().is_empty()); |
| 131 |
//assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 132 |
} |
| 133 |
|
| 134 |
#[test] |
| 135 |
fn openssh_contexts() { |
| 136 |
let path = super::openssh_contexts().unwrap(); |
| 137 |
assert!(!path.as_os_str().is_empty()); |
| 138 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 139 |
} |
| 140 |
|
| 141 |
#[test] |
| 142 |
fn snapperd_contexts() { |
| 143 |
let path = super::snapperd_contexts().unwrap(); |
| 144 |
assert!(!path.as_os_str().is_empty()); |
| 145 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 146 |
} |
| 147 |
|
| 148 |
#[test] |
| 149 |
fn systemd_contexts() { |
| 150 |
let path = super::systemd_contexts().unwrap(); |
| 151 |
assert!(!path.as_os_str().is_empty()); |
| 152 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 153 |
} |
| 154 |
|
| 155 |
#[test] |
| 156 |
fn contexts() { |
| 157 |
let path = super::contexts().unwrap(); |
| 158 |
assert!(!path.as_os_str().is_empty()); |
| 159 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 160 |
} |
| 161 |
|
| 162 |
#[test] |
| 163 |
fn securetty_types() { |
| 164 |
let path = super::securetty_types().unwrap(); |
| 165 |
assert!(!path.as_os_str().is_empty()); |
| 166 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 167 |
} |
| 168 |
|
| 169 |
#[test] |
| 170 |
fn booleans_subs() { |
| 171 |
let path = super::booleans_subs().unwrap(); |
| 172 |
assert!(!path.as_os_str().is_empty()); |
| 173 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 174 |
} |
| 175 |
|
| 176 |
#[test] |
| 177 |
fn customizable_types() { |
| 178 |
let path = super::customizable_types().unwrap(); |
| 179 |
assert!(!path.as_os_str().is_empty()); |
| 180 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 181 |
} |
| 182 |
|
| 183 |
#[test] |
| 184 |
fn users_conf() { |
| 185 |
let path = super::users_conf().unwrap(); |
| 186 |
assert!(!path.as_os_str().is_empty()); |
| 187 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 188 |
} |
| 189 |
|
| 190 |
#[test] |
| 191 |
fn translations() { |
| 192 |
let path = super::translations().unwrap(); |
| 193 |
assert!(!path.as_os_str().is_empty()); |
| 194 |
assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 195 |
} |
| 196 |
|
| 197 |
#[test] |
| 198 |
fn colors() { |
| 199 |
let path = super::colors().unwrap(); |
| 200 |
assert!(!path.as_os_str().is_empty()); |
| 201 |
//assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 202 |
} |
| 203 |
|
| 204 |
#[test] |
| 205 |
fn netfilter_context() { |
| 206 |
let path = super::netfilter_context().unwrap(); |
| 207 |
assert!(!path.as_os_str().is_empty()); |
| 208 |
//assert!(path.exists() || crate::current_mode() == crate::SELinuxMode::NotRunning); |
| 209 |
} |