Skip to content

Commit

Permalink
[test/{nfs|smb}*.rb] Update for self mounting
Browse files Browse the repository at this point in the history
Moving forward, we will not be supporting the automatic connection of
file storage backends, so this will now need to be managed by the user
themselves.

By association, this means the tests themselves also need to manage the
connection.  To ensure the connection is working properly, we connect
once for creating the backup, and a separate time (in a new location)
when validating the DB.  This helps ensure that we are not just writing
randomly to the filesystem, but the mounted network drive as expected.
  • Loading branch information
NickLaMuro committed Jul 7, 2021
1 parent 34a5cc1 commit 1127e3a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
17 changes: 14 additions & 3 deletions test/nfs_backup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ class NFSBackupTest < BaseBackupTest

def test_nfs_database_backup
console_nfs_backup_file = "console_full_nfs_backup.tar.gz"
ApplianceConsoleRunner.backup console_nfs_backup_file, :nfs

run_in_mount :nfs do |mount_point|
mount_file = File.join(mount_point, "db_backup", console_nfs_backup_file)
ApplianceConsoleRunner.backup mount_file, :nfs
end

run_in_mount :nfs do |mount_point|
mount_file = File.join(mount_point, "db_backup", console_nfs_backup_file)
Expand All @@ -20,7 +24,10 @@ def test_nfs_database_backup
def test_nfs_database_dump
console_nfs_dump_file = "console_full_nfs_dump.tar.gz"

ApplianceConsoleRunner.dump console_nfs_dump_file, :nfs
run_in_mount :nfs do |mount_point|
mount_file = File.join(mount_point, "db_dump", console_nfs_dump_file)
ApplianceConsoleRunner.dump mount_file, :nfs
end

run_in_mount :nfs do |mount_point|
mount_file = File.join(mount_point, "db_dump", console_nfs_dump_file)
Expand All @@ -32,7 +39,11 @@ def test_nfs_database_dump

def test_nfs_database_dump_excluding_custom_attributes
console_nfs_dump_file_without_ca = "console_partial_nfs_dump_without_custom_attributes.tar.gz"
ApplianceConsoleRunner.dump_with_no_custom_attributes console_nfs_dump_file_without_ca, :nfs

run_in_mount :nfs do |mount_point|
mount_file = File.join(mount_point, "db_dump", console_nfs_dump_file_without_ca)
ApplianceConsoleRunner.dump_with_no_custom_attributes mount_file, :nfs
end

run_in_mount :nfs do |mount_point|
mount_file = File.join(mount_point, "db_dump", console_nfs_dump_file_without_ca)
Expand Down
17 changes: 14 additions & 3 deletions test/smb_backup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ class SMBBackupTest < BaseBackupTest

def test_smb_database_backup
console_smb_backup_file = "console_full_smb_backup.tar.gz"
ApplianceConsoleRunner.backup console_smb_backup_file, :smb

run_in_mount :smb do |mount_point|
mount_file = File.join(mount_point, "db_backup", console_smb_backup_file)
ApplianceConsoleRunner.backup mount_file, :smb
end

run_in_mount :smb do |mount_point|
mount_file = File.join(mount_point, "db_backup", console_smb_backup_file)
Expand All @@ -20,7 +24,10 @@ def test_smb_database_backup
def test_smb_database_dump
console_smb_dump_file = "console_full_smb_dump.tar.gz"

ApplianceConsoleRunner.dump console_smb_dump_file, :smb
run_in_mount :smb do |mount_point|
mount_file = File.join(mount_point, "db_dump", console_smb_dump_file)
ApplianceConsoleRunner.dump mount_file, :smb
end

run_in_mount :smb do |mount_point|
mount_file = File.join(mount_point, "db_dump", console_smb_dump_file)
Expand All @@ -32,7 +39,11 @@ def test_smb_database_dump

def test_smb_database_dump_excluding_custom_attributes
console_smb_dump_file_without_ca = "console_partial_smb_dump_without_custom_attributes.tar.gz"
ApplianceConsoleRunner.dump_with_no_custom_attributes console_smb_dump_file_without_ca, :smb

run_in_mount :smb do |mount_point|
mount_file = File.join(mount_point, "db_dump", console_smb_dump_file_without_ca)
ApplianceConsoleRunner.dump_with_no_custom_attributes mount_file, :smb
end

run_in_mount :smb do |mount_point|
mount_file = File.join(mount_point, "db_dump", console_smb_dump_file_without_ca)
Expand Down

0 comments on commit 1127e3a

Please sign in to comment.