Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect kernel version before swap file creation #428

Merged
merged 20 commits into from
Aug 18, 2020

Commits on Jun 11, 2020

  1. Detect kernel version before swap file creation

    According to man page `man 8 swapon', "Preallocated swap files are
    supported on XFS since Linux 4.18". This patch checks for kernel version
    before attepting to create swapfile, using dd for XFS only on kernel
    versions <= 4.18 or btrfs.
    
    Signed-off-by: Eduardo Otubo <otubo@redhat.com>
    otubo committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    a56ef54 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f2eae6a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    73f97e9 View commit details
    Browse the repository at this point in the history
  4. Replace regex by os function calls

    Replaced the regex by the os function calls and put it on a separate
    function inside util.py module.
    
    Signed-off-by: Eduardo Otubo <otubo@redhat.com>
    otubo committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    c746b03 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e5fc9d4 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2020

  1. adding @lru_cache() as the kernel version is unlikely to change durin…

    …g the runtime of cloud-init.
    otubo committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    183c5ae View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2020

  1. Update cloudinit/config/cc_mounts.py

    Co-authored-by: Daniel Watkins <daniel@daniel-watkins.co.uk>
    otubo and OddBloke authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    bf109a0 View commit details
    Browse the repository at this point in the history
  2. Adding tests for util.kernel_version() new function

    Signed-off-by: Eduardo Otubo <otubo@redhat.com>
    otubo committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    ec1f08b View commit details
    Browse the repository at this point in the history
  3. Adding test to check swap file creation method

    Signed-off-by: Eduardo Otubo <otubo@redhat.com>
    otubo committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    d2cd4b4 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2020

  1. Configuration menu
    Copy the full SHA
    d01111b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4f6b9fc View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2020

  1. Wrapping test_kernel_version() into class

    Wrapping test_kernel_version() into class TestKernelVersion() and
    adding pytest parametrize decoration. In order to have it working,
    the cache decoration would have to be removed, though. Otherwise the
    function cache would always return the same value and would fail the
    tests.
    
    Signed-off-by: Eduardo Otubo <otubo@redhat.com>
    otubo committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    d33cea3 View commit details
    Browse the repository at this point in the history
  2. Splitting test_swap_creation_method() test into 3

    Splitting test_swap_creation_method into 3 different cases for different
    filesystems. Leaving the methods way of asserting the test with only
    cc_mounts.handle() function. Like test_swap_integrity() does.
    
    Signed-off-by: Eduardo Otubo <otubo@redhat.com>
    
    [0] pytest-dev/pytest#3484
    otubo committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    52f1ca5 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2020

  1. Moving swap tests from TestFstabHandling to TestSwapFileCreation

    Creating a new class of tests TestSwapFileCreation() for this purpose.
    The class still uses test_helpers.FilesystemMockingTestCase to mock
    a file system so swap file can be created.
    
    Also added a check on cloudinit/config/cc_mounts.py to make sure the
    swap file really exists, which is not the case on unittests. The swap
    file is not being created, the test just makes sure if the correct calls
    are being done.
    
    Signed-off-by: Eduardo Otubo <otubo@redhat.com>
    otubo committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    a2527be View commit details
    Browse the repository at this point in the history
  2. removing blank line again

    otubo committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    8082a78 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2020

  1. Configuration menu
    Copy the full SHA
    474c47b View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2020

  1. Configuration menu
    Copy the full SHA
    a521f6c View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2020

  1. Configuration menu
    Copy the full SHA
    2a8239c View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2020

  1. Configuration menu
    Copy the full SHA
    97801c7 View commit details
    Browse the repository at this point in the history
  2. fixing merge, removing pytest import (done by my patch) and removing …

    …blank line added by merge
    otubo committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    9b0ac2c View commit details
    Browse the repository at this point in the history