Exemple #1
0
    def test_CreateEc2AmiBackup(self):
        print(f"ec2 ami - Running backup test")

        ec2_ami_backup_engine = ShelveryEC2AMIBackup()
        print(f"ec2 ami - Shelvery backup initialised")

        backups = initCreateBackups(ec2_ami_backup_engine)

        ec2_client = AwsHelper.boto3_client('ec2')

        valid = False
        # validate there is
        for backup in backups:

            #Get source snapshot
            source_snapshot = ec2_client.describe_snapshots(
                Filters=[{
                    'Name': 'tag:Name',
                    'Values': [backup.name]
                }])

            #Get snapshot id and add to created snapshot list for removal in teardown later
            dest_snapshot_id = source_snapshot['Snapshots'][0]['SnapshotId']
            self.created_snapshots.append(dest_snapshot_id)

            valid = compareBackups(self=self,
                                   backup=backup,
                                   backup_engine=ec2_ami_backup_engine)

        self.assertTrue(valid)
Exemple #2
0
    def test_CreateRdsBackup(self):
        print(f"rds - Running backup test")

        rds_backup_engine = ShelveryRDSBackup()
        print(f"rds - Shelvery backup initialised")

        backups = initCreateBackups(rds_backup_engine)
        print("Created RDS backups")

        valid = False

        # validate there is
        for backup in backups:
            valid = compareBackups(self=self,
                                   backup=backup,
                                   backup_engine=rds_backup_engine)
        self.assertTrue(valid)
    def test_CreateDocDbBackup(self):

        print(f"docdb - Running backup test")

        docdb_cluster_backup_engine = ShelveryDocumentDbBackup()
        print(f"docdb - Shelvery backup initialised")
        
        backups = initCreateBackups(docdb_cluster_backup_engine)
        print("Created Doc DB Cluster backups")

        valid = False
        
        # validate there is
        for backup in backups:
            valid = compareBackups(self=self,
                           backup=backup,
                           backup_engine=docdb_cluster_backup_engine
                           )
        self.assertTrue(valid)