"Fossies" - the Fresh Open Source Software Archive

Member "tc-play-3.3/test/features/modify_vol_cli.feature" (2 Mar 2020, 14037 Bytes) of package /linux/misc/tc-play-3.3.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "modify_vol_cli.feature": 1.1_vs_2.0.

    1 @cmdline
    2 Feature: Command line volume modification
    3 
    4   Scenario: Simple volume #1 (change passphrase, pos)
    5     Given I create a volume tmpvol1 of size 10M with the following parameters:
    6       | passphrase     | test             |
    7       | pbkdf_prf      | SHA512           |
    8       | cipher         | AES-256-XTS      |
    9     And I modify volume tmpvol1 using the following settings:
   10       | passphrase     | test             |
   11       | new_passphrase | new              |
   12     And I map volume tmpvol1 as tcplay_test using the following settings:
   13       | passphrase     | new              |
   14     And I request information about volume tmpvol1 using the following settings:
   15       | passphrase     | new              |
   16     Then I expect tcplay to succeed
   17     And I expect dmsetup to have the following tables:
   18       | name           | begin   | end     | algo                  | offset    | iv_offset     |
   19       | tcplay_test    | 0       | 19968   | aes-xts-plain64       | 256       | 256           |
   20     And I expect tcplay to report the following:
   21       | PBKDF2 PRF         | SHA512            |
   22       | PBKDF2 iterations  | 1000              |
   23       | Cipher             | AES-256-XTS       |
   24       | Key Length         | 512 bits          |
   25       | Sector size        | 512               |
   26       | Volume size        | 19968 sectors     |
   27       | IV offset          | 256 sectors       |
   28       | Block offset       | 256 sectors       |
   29 
   30   Scenario: Simple volume #1 (change PBKDF PRF)
   31     Given I create a volume tmpvol1 of size 10M with the following parameters:
   32       | passphrase     | test             |
   33       | pbkdf_prf      | SHA512           |
   34       | cipher         | AES-256-XTS      |
   35     And I modify volume tmpvol1 using the following settings:
   36       | passphrase     | test             |
   37       | new_passphrase | test             |
   38       | new_pbkdf_prf  | whirlpool        |
   39     And I map volume tmpvol1 as tcplay_test using the following settings:
   40       | passphrase     | test             |
   41     And I request information about volume tmpvol1 using the following settings:
   42       | passphrase     | test             |
   43     Then I expect tcplay to succeed
   44     And I expect dmsetup to have the following tables:
   45       | name           | begin   | end     | algo                  | offset    | iv_offset     |
   46       | tcplay_test    | 0       | 19968   | aes-xts-plain64       | 256       | 256           |
   47     And I expect tcplay to report the following:
   48       | PBKDF2 PRF         | whirlpool         |
   49       | PBKDF2 iterations  | 1000              |
   50       | Cipher             | AES-256-XTS       |
   51       | Key Length         | 512 bits          |
   52       | Sector size        | 512               |
   53       | Volume size        | 19968 sectors     |
   54       | IV offset          | 256 sectors       |
   55       | Block offset       | 256 sectors       |
   56 
   57   Scenario: Cascade volume #1 (change passphrase)
   58     Given I create a volume tmpvol1 of size 10M with the following parameters:
   59       | passphrase     | test                             |
   60       | pbkdf_prf      | whirlpool                        |
   61       | cipher         | AES-256-XTS,SERPENT-256-XTS      |
   62     And I modify volume tmpvol1 using the following settings:
   63       | passphrase     | test             |
   64       | new_passphrase | new              |
   65     And I map volume tmpvol1 as tcplay_test using the following settings:
   66       | passphrase     | new              |
   67     And I request information about volume tmpvol1 using the following settings:
   68       | passphrase     | new              |
   69     Then I expect dmsetup to have the following tables:
   70       | name           | begin   | end     | algo                  | offset    | iv_offset     |
   71       | tcplay_test.0  | 0       | 19968   | serpent-xts-plain64   | 256       | 256           |
   72       | tcplay_test    | 0       | 19968   | aes-xts-plain64       | 256       | 0             |
   73     And I expect tcplay to report the following:
   74       | PBKDF2 PRF         | whirlpool                   |
   75       | PBKDF2 iterations  | 1000                        |
   76       | Cipher             | AES-256-XTS,SERPENT-256-XTS |
   77       | Key Length         | 1024 bits                   |
   78       | Sector size        | 512                         |
   79       | Volume size        | 19968 sectors               |
   80       | IV offset          | 256 sectors                 |
   81       | Block offset       | 256 sectors                 |
   82 
   83   Scenario: Hidden volume #1 (change passphrase)
   84     Given I create a volume tmpvol1 of size 10M with the following parameters:
   85       | passphrase        | test                             |
   86       | pbkdf_prf         | whirlpool                        |
   87       | cipher            | TWOFISH-256-XTS                  |
   88       | create_hidden     | yes                              |
   89       | hidden_mb         | 2                                |
   90       | keyfiles_hidden   | key.2                            |
   91       | pbkdf_prf_hidden  | RIPEMD160                        |
   92       | cipher_hidden     | SERPENT-256-XTS                  |
   93     And I modify volume tmpvol1 using the following settings:
   94       | prompt_skipped | true              |
   95       | keyfiles       | key.2             |
   96       | new_passphrase | new_hidden        |
   97     And I map volume tmpvol1 as tcplay_test using the following settings:
   98       | passphrase     | test             |
   99     And I request information about volume tmpvol1 using the following settings:
  100       | passphrase     | test             |
  101     Then I expect dmsetup to have the following tables:
  102       | name           | begin   | end     | algo                  | offset    | iv_offset     |
  103       | tcplay_test    | 0       | 19968   | twofish-xts-plain64   | 256       | 256           |
  104     And I expect tcplay to report the following:
  105       | PBKDF2 PRF         | whirlpool                   |
  106       | PBKDF2 iterations  | 1000                        |
  107       | Cipher             | TWOFISH-256-XTS             |
  108       | Key Length         | 512 bits                    |
  109       | Sector size        | 512                         |
  110       | Volume size        | 19968 sectors               |
  111       | IV offset          | 256 sectors                 |
  112       | Block offset       | 256 sectors                 |
  113 
  114   Scenario: Hidden volume #2 (change passphrase, keyfiles)
  115     Given I create a volume tmpvol1 of size 10M with the following parameters:
  116       | passphrase        | test                             |
  117       | pbkdf_prf         | whirlpool                        |
  118       | cipher            | TWOFISH-256-XTS                  |
  119       | create_hidden     | yes                              |
  120       | hidden_mb         | 2                                |
  121       | keyfiles_hidden   | key.2                            |
  122       | pbkdf_prf_hidden  | RIPEMD160                        |
  123       | cipher_hidden     | SERPENT-256-XTS                  |
  124     And I modify volume tmpvol1 using the following settings:
  125       | keyfiles       | key.2             |
  126       | prompt_skipped | yes               |
  127       | new_passphrase | new_hidden        |
  128       | new_keyfiles   | key.1, key.2      |
  129     And I map volume tmpvol1 as tcplay_test using the following settings:
  130       | passphrase        | new_hidden     |
  131       | keyfiles          | key.1, key.2   |
  132     And I request information about volume tmpvol1 using the following settings:
  133       | passphrase        | new_hidden     |
  134       | keyfiles          | key.1, key.2   |
  135     Then I expect dmsetup to have the following tables:
  136       | name           | begin   | end     | algo                  | offset    | iv_offset     |
  137       | tcplay_test    | 0       | 4096    | serpent-xts-plain64   | 16128     | 16128         |
  138     And I expect tcplay to report the following:
  139       | PBKDF2 PRF         | RIPEMD160                   |
  140       | PBKDF2 iterations  | 2000                        |
  141       | Cipher             | SERPENT-256-XTS             |
  142       | Key Length         | 512 bits                    |
  143       | Sector size        | 512                         |
  144       | Volume size        | 4096 sectors                |
  145       | IV offset          | 16128 sectors               |
  146       | Block offset       | 16128 sectors               |
  147 
  148   Scenario: Hidden volume #3 (change keyfiles, PBKDF PRF)
  149     Given I create a volume tmpvol1 of size 10M with the following parameters:
  150       | passphrase        | test                             |
  151       | pbkdf_prf         | whirlpool                        |
  152       | cipher            | TWOFISH-256-XTS                  |
  153       | create_hidden     | yes                              |
  154       | hidden_mb         | 2                                |
  155       | keyfiles_hidden   | key.2                            |
  156       | pbkdf_prf_hidden  | RIPEMD160                        |
  157       | cipher_hidden     | SERPENT-256-XTS                  |
  158     And I modify volume tmpvol1 using the following settings:
  159       | keyfiles       | key.2             |
  160       | new_keyfiles   | key.1, key.2      |
  161       | new_pbkdf_prf  | SHA512            |
  162     And I map volume tmpvol1 as tcplay_test using the following settings:
  163       | keyfiles          | key.1, key.2   |
  164       | prompt_skipped    | yes            |
  165     And I request information about volume tmpvol1 using the following settings:
  166       | keyfiles          | key.1, key.2   |
  167       | prompt_skipped    | yes            |
  168     Then I expect dmsetup to have the following tables:
  169       | name           | begin   | end     | algo                  | offset    | iv_offset     |
  170       | tcplay_test    | 0       | 4096    | serpent-xts-plain64   | 16128     | 16128         |
  171     And I expect tcplay to report the following:
  172       | PBKDF2 PRF         | SHA512                      |
  173       | PBKDF2 iterations  | 1000                        |
  174       | Cipher             | SERPENT-256-XTS             |
  175       | Key Length         | 512 bits                    |
  176       | Sector size        | 512                         |
  177       | Volume size        | 4096 sectors                |
  178       | IV offset          | 16128 sectors               |
  179       | Block offset       | 16128 sectors               |
  180 
  181   Scenario: Hidden volume #4 (restore from backup, outer)
  182     Given I create a volume tmpvol1 of size 10M with the following parameters:
  183       | passphrase        | test                             |
  184       | pbkdf_prf         | whirlpool                        |
  185       | cipher            | TWOFISH-256-XTS                  |
  186       | create_hidden     | yes                              |
  187       | hidden_mb         | 2                                |
  188       | keyfiles_hidden   | key.2                            |
  189       | pbkdf_prf_hidden  | RIPEMD160                        |
  190       | cipher_hidden     | SERPENT-256-XTS                  |
  191     And I corrupt sector 0 of volume tmpvol1
  192     And I modify volume tmpvol1 by restoring from the backup header using the following settings:
  193       | passphrase     | test             |
  194     And I map volume tmpvol1 as tcplay_test using the following settings:
  195       | passphrase     | test             |
  196     And I request information about volume tmpvol1 using the following settings:
  197       | passphrase     | test             |
  198     Then I expect dmsetup to have the following tables:
  199       | name           | begin   | end     | algo                  | offset    | iv_offset     |
  200       | tcplay_test    | 0       | 19968   | twofish-xts-plain64   | 256       | 256           |
  201     And I expect tcplay to report the following:
  202       | PBKDF2 PRF         | whirlpool                   |
  203       | PBKDF2 iterations  | 1000                        |
  204       | Cipher             | TWOFISH-256-XTS             |
  205       | Key Length         | 512 bits                    |
  206       | Sector size        | 512                         |
  207       | Volume size        | 19968 sectors               |
  208       | IV offset          | 256 sectors                 |
  209       | Block offset       | 256 sectors                 |
  210 
  211   Scenario: Hidden volume #5 (restore from backup, hidden)
  212     Given I create a volume tmpvol1 of size 10M with the following parameters:
  213       | passphrase        | test                             |
  214       | pbkdf_prf         | whirlpool                        |
  215       | cipher            | TWOFISH-256-XTS                  |
  216       | create_hidden     | yes                              |
  217       | hidden_mb         | 2                                |
  218       | keyfiles_hidden   | key.2                            |
  219       | pbkdf_prf_hidden  | RIPEMD160                        |
  220       | cipher_hidden     | SERPENT-256-XTS                  |
  221     And I corrupt sector 128 of volume tmpvol1
  222     And I modify volume tmpvol1 by restoring from the backup header using the following settings:
  223       | keyfiles          | key.2          |
  224       | prompt_skipped    | yes            |
  225     And I map volume tmpvol1 as tcplay_test using the following settings:
  226       | keyfiles          | key.2          |
  227       | prompt_skipped    | yes            |
  228     And I request information about volume tmpvol1 using the following settings:
  229       | keyfiles          | key.2          |
  230       | prompt_skipped    | yes            |
  231     Then I expect dmsetup to have the following tables:
  232       | name           | begin   | end     | algo                  | offset    | iv_offset     |
  233       | tcplay_test    | 0       | 4096    | serpent-xts-plain64   | 16128     | 16128         |
  234     And I expect tcplay to report the following:
  235       | PBKDF2 PRF         | RIPEMD160                   |
  236       | PBKDF2 iterations  | 2000                        |
  237       | Cipher             | SERPENT-256-XTS             |
  238       | Key Length         | 512 bits                    |
  239       | Sector size        | 512                         |
  240       | Volume size        | 4096 sectors                |
  241       | IV offset          | 16128 sectors               |
  242       | Block offset       | 16128 sectors               |