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

[EvmDatabaseOps] Fix .validate_free_space target #18745

Merged

Commits on May 16, 2019

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

Commits on May 17, 2019

  1. [EvmDatabaseOps] Fix .validate_free_space target

    Currently, `db_opts[:local_file]` will always be a FIFO with the new
    file_storage mechanisms, so `.validate_free_space` will only check
    against the tmp dir, which usually isn't very large and not the target
    destination for the DB backup/dump.
    
    This fix moves the check to a place were we can get access to the
    file_storage object directly and target the directory of the mounted
    filesystem that will receive the backup/dump.
    
    To that end, the check now only applies to file storage classes that are
    "mountable", since checking against non-mountable storages don't make
    sense (s3/swift don't have this capability, and they are assumed to be
    "infinite" anyway, and I don't think you can query FTP for available
    storage as well so I think the same assumption is also fair to apply)
    
    * * *
    
    Quick note:
    
    In a couple of spots in the tests, the following is added:
    
        allow(file_storage).to receive(:class).and_return(MiqSmbSession)
    
    Despite `file_storage` being defined above with:
    
        let(:file_storage) { double("MiqSmbSession", :disconnect => nil) }
    
    This is now required after moving validate_free_space to inside the
    with_file_storage method, and wrapping it in a class check of:
    
        if file_storage.class <= MiqGenericMountSession
    
    This "stubs the stub" to have it act like a MiqSmbSession, when in fact,
    it isn't.  Unfortunately, this can't be used globally since it causes a
    bunch of other tests failures.
    NickLaMuro committed May 17, 2019
    Configuration menu
    Copy the full SHA
    cb13d74 View commit details
    Browse the repository at this point in the history