|
248 | 248 | expect(encryption.label).to be_nil |
249 | 249 | end |
250 | 250 | end |
| 251 | + |
| 252 | + context "if 'encryption' is 'random_swap' (snake_case)" do |
| 253 | + let(:encryption) { "random_swap" } |
| 254 | + |
| 255 | + it "sets #encryption to the expected value" do |
| 256 | + config = subject.convert |
| 257 | + encryption = config.encryption |
| 258 | + expect(encryption).to be_a(Agama::Storage::Configs::Encryption) |
| 259 | + expect(encryption.method).to eq(Y2Storage::EncryptionMethod::RANDOM_SWAP) |
| 260 | + end |
| 261 | + end |
| 262 | + |
| 263 | + context "if 'encryption' is 'randomSwap' (camelCase)" do |
| 264 | + let(:encryption) { "randomSwap" } |
| 265 | + |
| 266 | + it "sets #encryption to the expected value" do |
| 267 | + config = subject.convert |
| 268 | + encryption = config.encryption |
| 269 | + expect(encryption).to be_a(Agama::Storage::Configs::Encryption) |
| 270 | + expect(encryption.method).to eq(Y2Storage::EncryptionMethod::RANDOM_SWAP) |
| 271 | + end |
| 272 | + end |
| 273 | + |
| 274 | + context "if 'encryption' is 'protected_swap' (snake_case)" do |
| 275 | + let(:encryption) { "protected_swap" } |
| 276 | + |
| 277 | + it "sets #encryption to the expected value" do |
| 278 | + config = subject.convert |
| 279 | + encryption = config.encryption |
| 280 | + expect(encryption).to be_a(Agama::Storage::Configs::Encryption) |
| 281 | + expect(encryption.method).to eq(Y2Storage::EncryptionMethod::PROTECTED_SWAP) |
| 282 | + end |
| 283 | + end |
| 284 | + |
| 285 | + context "if 'encryption' is 'protectedSwap' (camelCase)" do |
| 286 | + let(:encryption) { "protectedSwap" } |
| 287 | + |
| 288 | + it "sets #encryption to the expected value" do |
| 289 | + config = subject.convert |
| 290 | + encryption = config.encryption |
| 291 | + expect(encryption).to be_a(Agama::Storage::Configs::Encryption) |
| 292 | + expect(encryption.method).to eq(Y2Storage::EncryptionMethod::PROTECTED_SWAP) |
| 293 | + end |
| 294 | + end |
| 295 | + |
| 296 | + context "if 'encryption' is 'secure_swap' (snake_case)" do |
| 297 | + let(:encryption) { "secure_swap" } |
| 298 | + |
| 299 | + it "sets #encryption to the expected value" do |
| 300 | + config = subject.convert |
| 301 | + encryption = config.encryption |
| 302 | + expect(encryption).to be_a(Agama::Storage::Configs::Encryption) |
| 303 | + expect(encryption.method).to eq(Y2Storage::EncryptionMethod::SECURE_SWAP) |
| 304 | + end |
| 305 | + end |
| 306 | + |
| 307 | + context "if 'encryption' is 'secureSwap' (camelCase)" do |
| 308 | + let(:encryption) { "secureSwap" } |
| 309 | + |
| 310 | + it "sets #encryption to the expected value" do |
| 311 | + config = subject.convert |
| 312 | + encryption = config.encryption |
| 313 | + expect(encryption).to be_a(Agama::Storage::Configs::Encryption) |
| 314 | + expect(encryption.method).to eq(Y2Storage::EncryptionMethod::SECURE_SWAP) |
| 315 | + end |
| 316 | + end |
251 | 317 | end |
252 | 318 | end |
253 | 319 |
|
|
0 commit comments