How to use list_backups method in tempest

Best Python code snippet using tempest_python

hww_pb2.pyi

Source:hww_pb2.pyi Github

copy

Full Screen

...91 def check_sdcard(self) -> bitbox02_system_pb2.CheckSDCardRequest: ...92 @property93 def set_mnemonic_passphrase_enabled(self) -> mnemonic_pb2.SetMnemonicPassphraseEnabledRequest: ...94 @property95 def list_backups(self) -> backup_commands_pb2.ListBackupsRequest: ...96 @property97 def restore_backup(self) -> backup_commands_pb2.RestoreBackupRequest: ...98 @property99 def perform_attestation(self) -> perform_attestation_pb2.PerformAttestationRequest: ...100 @property101 def reboot(self) -> system_pb2.RebootRequest: ...102 @property103 def check_backup(self) -> backup_commands_pb2.CheckBackupRequest: ...104 @property105 def eth(self) -> eth_pb2.ETHRequest: ...106 @property107 def reset(self) -> bitbox02_system_pb2.ResetRequest: ...108 @property109 def restore_from_mnemonic(self) -> mnemonic_pb2.RestoreFromMnemonicRequest: ...110 @property111 def fingerprint(self) -> common_pb2.RootFingerprintRequest:112 """removed: BitBoxBaseRequest bitboxbase = 23;"""113 pass114 @property115 def btc(self) -> btc_pb2.BTCRequest: ...116 @property117 def electrum_encryption_key(self) -> keystore_pb2.ElectrumEncryptionKeyRequest: ...118 @property119 def cardano(self) -> cardano_pb2.CardanoRequest: ...120 def __init__(self,121 *,122 device_name : typing.Optional[bitbox02_system_pb2.SetDeviceNameRequest] = ...,123 device_language : typing.Optional[bitbox02_system_pb2.SetDeviceLanguageRequest] = ...,124 device_info : typing.Optional[bitbox02_system_pb2.DeviceInfoRequest] = ...,125 set_password : typing.Optional[bitbox02_system_pb2.SetPasswordRequest] = ...,126 create_backup : typing.Optional[backup_commands_pb2.CreateBackupRequest] = ...,127 show_mnemonic : typing.Optional[mnemonic_pb2.ShowMnemonicRequest] = ...,128 btc_pub : typing.Optional[btc_pb2.BTCPubRequest] = ...,129 btc_sign_init : typing.Optional[btc_pb2.BTCSignInitRequest] = ...,130 btc_sign_input : typing.Optional[btc_pb2.BTCSignInputRequest] = ...,131 btc_sign_output : typing.Optional[btc_pb2.BTCSignOutputRequest] = ...,132 insert_remove_sdcard : typing.Optional[bitbox02_system_pb2.InsertRemoveSDCardRequest] = ...,133 check_sdcard : typing.Optional[bitbox02_system_pb2.CheckSDCardRequest] = ...,134 set_mnemonic_passphrase_enabled : typing.Optional[mnemonic_pb2.SetMnemonicPassphraseEnabledRequest] = ...,135 list_backups : typing.Optional[backup_commands_pb2.ListBackupsRequest] = ...,136 restore_backup : typing.Optional[backup_commands_pb2.RestoreBackupRequest] = ...,137 perform_attestation : typing.Optional[perform_attestation_pb2.PerformAttestationRequest] = ...,138 reboot : typing.Optional[system_pb2.RebootRequest] = ...,139 check_backup : typing.Optional[backup_commands_pb2.CheckBackupRequest] = ...,140 eth : typing.Optional[eth_pb2.ETHRequest] = ...,141 reset : typing.Optional[bitbox02_system_pb2.ResetRequest] = ...,142 restore_from_mnemonic : typing.Optional[mnemonic_pb2.RestoreFromMnemonicRequest] = ...,143 fingerprint : typing.Optional[common_pb2.RootFingerprintRequest] = ...,144 btc : typing.Optional[btc_pb2.BTCRequest] = ...,145 electrum_encryption_key : typing.Optional[keystore_pb2.ElectrumEncryptionKeyRequest] = ...,146 cardano : typing.Optional[cardano_pb2.CardanoRequest] = ...,147 ) -> None: ...148 def HasField(self, field_name: typing_extensions.Literal["btc",b"btc","btc_pub",b"btc_pub","btc_sign_init",b"btc_sign_init","btc_sign_input",b"btc_sign_input","btc_sign_output",b"btc_sign_output","cardano",b"cardano","check_backup",b"check_backup","check_sdcard",b"check_sdcard","create_backup",b"create_backup","device_info",b"device_info","device_language",b"device_language","device_name",b"device_name","electrum_encryption_key",b"electrum_encryption_key","eth",b"eth","fingerprint",b"fingerprint","insert_remove_sdcard",b"insert_remove_sdcard","list_backups",b"list_backups","perform_attestation",b"perform_attestation","reboot",b"reboot","request",b"request","reset",b"reset","restore_backup",b"restore_backup","restore_from_mnemonic",b"restore_from_mnemonic","set_mnemonic_passphrase_enabled",b"set_mnemonic_passphrase_enabled","set_password",b"set_password","show_mnemonic",b"show_mnemonic"]) -> builtins.bool: ...149 def ClearField(self, field_name: typing_extensions.Literal["btc",b"btc","btc_pub",b"btc_pub","btc_sign_init",b"btc_sign_init","btc_sign_input",b"btc_sign_input","btc_sign_output",b"btc_sign_output","cardano",b"cardano","check_backup",b"check_backup","check_sdcard",b"check_sdcard","create_backup",b"create_backup","device_info",b"device_info","device_language",b"device_language","device_name",b"device_name","electrum_encryption_key",b"electrum_encryption_key","eth",b"eth","fingerprint",b"fingerprint","insert_remove_sdcard",b"insert_remove_sdcard","list_backups",b"list_backups","perform_attestation",b"perform_attestation","reboot",b"reboot","request",b"request","reset",b"reset","restore_backup",b"restore_backup","restore_from_mnemonic",b"restore_from_mnemonic","set_mnemonic_passphrase_enabled",b"set_mnemonic_passphrase_enabled","set_password",b"set_password","show_mnemonic",b"show_mnemonic"]) -> None: ...150 def WhichOneof(self, oneof_group: typing_extensions.Literal["request",b"request"]) -> typing.Optional[typing_extensions.Literal["device_name","device_language","device_info","set_password","create_backup","show_mnemonic","btc_pub","btc_sign_init","btc_sign_input","btc_sign_output","insert_remove_sdcard","check_sdcard","set_mnemonic_passphrase_enabled","list_backups","restore_backup","perform_attestation","reboot","check_backup","eth","reset","restore_from_mnemonic","fingerprint","btc","electrum_encryption_key","cardano"]]: ...151global___Request = Request152class Response(google.protobuf.message.Message):153 DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...154 SUCCESS_FIELD_NUMBER: builtins.int155 ERROR_FIELD_NUMBER: builtins.int156 DEVICE_INFO_FIELD_NUMBER: builtins.int157 PUB_FIELD_NUMBER: builtins.int158 BTC_SIGN_NEXT_FIELD_NUMBER: builtins.int159 LIST_BACKUPS_FIELD_NUMBER: builtins.int160 CHECK_BACKUP_FIELD_NUMBER: builtins.int161 PERFORM_ATTESTATION_FIELD_NUMBER: builtins.int162 CHECK_SDCARD_FIELD_NUMBER: builtins.int163 ETH_FIELD_NUMBER: builtins.int164 FINGERPRINT_FIELD_NUMBER: builtins.int165 BTC_FIELD_NUMBER: builtins.int166 ELECTRUM_ENCRYPTION_KEY_FIELD_NUMBER: builtins.int167 CARDANO_FIELD_NUMBER: builtins.int168 @property169 def success(self) -> global___Success: ...170 @property171 def error(self) -> global___Error: ...172 @property173 def device_info(self) -> bitbox02_system_pb2.DeviceInfoResponse:174 """removed: RandomNumberResponse random_number = 3;"""175 pass176 @property177 def pub(self) -> common_pb2.PubResponse: ...178 @property179 def btc_sign_next(self) -> btc_pb2.BTCSignNextResponse: ...180 @property181 def list_backups(self) -> backup_commands_pb2.ListBackupsResponse: ...182 @property183 def check_backup(self) -> backup_commands_pb2.CheckBackupResponse: ...184 @property185 def perform_attestation(self) -> perform_attestation_pb2.PerformAttestationResponse: ...186 @property187 def check_sdcard(self) -> bitbox02_system_pb2.CheckSDCardResponse: ...188 @property189 def eth(self) -> eth_pb2.ETHResponse: ...190 @property191 def fingerprint(self) -> common_pb2.RootFingerprintResponse: ...192 @property193 def btc(self) -> btc_pb2.BTCResponse: ...194 @property195 def electrum_encryption_key(self) -> keystore_pb2.ElectrumEncryptionKeyResponse: ......

Full Screen

Full Screen

backup_sample.py

Source:backup_sample.py Github

copy

Full Screen

...118 print("Database {} restored from backup is {}% optimized.".format(119 op.metadata.name, op.metadata.progress.progress_percent))120# [END spanner_list_database_operations]121# [START spanner_list_backups]122def list_backups(instance_id, database_id, backup_id):123 spanner_client = spanner.Client()124 instance = spanner_client.instance(instance_id)125 # List all backups.126 print("All backups:")127 for backup in instance.list_backups():128 print(backup.name)129 # List all backups that contain a name.130 print("All backups with backup name containing \"{}\":".format(backup_id))131 for backup in instance.list_backups(filter_="name:{}".format(backup_id)):132 print(backup.name)133 # List all backups for a database that contains a name.134 print("All backups with database name containing \"{}\":".format(database_id))135 for backup in instance.list_backups(filter_="database:{}".format(database_id)):136 print(backup.name)137 # List all backups that expire before a timestamp.138 expire_time = datetime.utcnow().replace(microsecond=0) + timedelta(days=30)139 print("All backups with expire_time before \"{}-{}-{}T{}:{}:{}Z\":".format(140 *expire_time.timetuple()))141 for backup in instance.list_backups(142 filter_="expire_time < \"{}-{}-{}T{}:{}:{}Z\"".format(143 *expire_time.timetuple())):144 print(backup.name)145 # List all backups with a size greater than some bytes.146 print("All backups with backup size more than 100 bytes:")147 for backup in instance.list_backups(filter_="size_bytes > 100"):148 print(backup.name)149 # List backups that were created after a timestamp that are also ready.150 create_time = datetime.utcnow().replace(microsecond=0) - timedelta(days=1)151 print("All backups created after \"{}-{}-{}T{}:{}:{}Z\" and are READY:".format(152 *create_time.timetuple()))153 for backup in instance.list_backups(154 filter_="create_time >= \"{}-{}-{}T{}:{}:{}Z\" AND state:READY".format(155 *create_time.timetuple())):156 print(backup.name)157 print("All backups with pagination")158 for page in instance.list_backups(page_size=2).pages:159 for backup in page:160 print(backup.name)161# [END spanner_list_backups]162# [START spanner_delete_backup]163def delete_backup(instance_id, backup_id):164 spanner_client = spanner.Client()165 instance = spanner_client.instance(instance_id)166 backup = instance.backup(backup_id)167 backup.reload()168 # Wait for databases that reference this backup to finish optimizing.169 while backup.referencing_databases:170 time.sleep(30)171 backup.reload()172 # Delete the backup.173 backup.delete()174 # Verify that the backup is deleted.175 assert backup.exists() is False176 print("Backup {} has been deleted.".format(backup.name))177# [END spanner_delete_backup]178# [START spanner_update_backup]179def update_backup(instance_id, backup_id):180 spanner_client = spanner.Client()181 instance = spanner_client.instance(instance_id)182 backup = instance.backup(backup_id)183 backup.reload()184 # Expire time must be within 366 days of the create time of the backup.185 old_expire_time = backup.expire_time186 new_expire_time = old_expire_time + timedelta(days=30)187 backup.update_expire_time(new_expire_time)188 print("Backup {} expire time was updated from {} to {}.".format(189 backup.name, old_expire_time, new_expire_time))190# [END spanner_update_backup]191if __name__ == '__main__': # noqa: C901192 parser = argparse.ArgumentParser(193 description=__doc__,194 formatter_class=argparse.RawDescriptionHelpFormatter)195 parser.add_argument(196 'instance_id', help='Your Cloud Spanner instance ID.')197 parser.add_argument(198 '--database-id', help='Your Cloud Spanner database ID.',199 default='example_db')200 parser.add_argument(201 '--backup-id', help='Your Cloud Spanner backup ID.',202 default='example_backup')203 subparsers = parser.add_subparsers(dest='command')204 subparsers.add_parser('create_backup', help=create_backup.__doc__)205 subparsers.add_parser('cancel_backup', help=cancel_backup.__doc__)206 subparsers.add_parser('update_backup', help=update_backup.__doc__)207 subparsers.add_parser('restore_database', help=restore_database.__doc__)208 subparsers.add_parser('list_backups', help=list_backups.__doc__)209 subparsers.add_parser('list_backup_operations', help=list_backup_operations.__doc__)210 subparsers.add_parser('list_database_operations',211 help=list_database_operations.__doc__)212 subparsers.add_parser('delete_backup', help=delete_backup.__doc__)213 args = parser.parse_args()214 if args.command == 'create_backup':215 create_backup(args.instance_id, args.database_id, args.backup_id)216 elif args.command == 'cancel_backup':217 cancel_backup(args.instance_id, args.database_id, args.backup_id)218 elif args.command == 'update_backup':219 update_backup(args.instance_id, args.backup_id)220 elif args.command == 'restore_database':221 restore_database(args.instance_id, args.database_id, args.backup_id)222 elif args.command == 'list_backups':223 list_backups(args.instance_id, args.database_id, args.backup_id)224 elif args.command == 'list_backup_operations':225 list_backup_operations(args.instance_id, args.database_id)226 elif args.command == 'list_database_operations':227 list_database_operations(args.instance_id)228 elif args.command == 'delete_backup':229 delete_backup(args.instance_id, args.backup_id)230 else:...

Full Screen

Full Screen

test_storage.py

Source:test_storage.py Github

copy

Full Screen

...49 HANDLED_FILES['written_files'] += [50 ('file_without_date', None)51 ]52 def test_nofilter(self):53 files = self.storage.list_backups()54 self.assertEqual(len(HANDLED_FILES['written_files'])-1, len(files))55 for file in files:56 self.assertNotEqual('file_without_date', file)57 def test_encrypted(self):58 files = self.storage.list_backups(encrypted=True)59 for file in files:60 self.assertIn('.gpg', file)61 def test_compressed(self):62 files = self.storage.list_backups(compressed=True)63 for file in files:64 self.assertIn('.gz', file)65 def test_not_encrypted(self):66 files = self.storage.list_backups(encrypted=False)67 for file in files:68 self.assertNotIn('.gpg', file)69 def test_not_compressed(self):70 files = self.storage.list_backups(compressed=False)71 for file in files:72 self.assertNotIn('.gz', file)73 def test_content_type_db(self):74 files = self.storage.list_backups(content_type='db')75 for file in files:76 self.assertIn('.db', file)77 def test_database(self):78 files = self.storage.list_backups(database='foodb')79 for file in files:80 self.assertIn('foodb', file)81 self.assertNotIn('bardb', file)82 self.assertNotIn('hamdb', file)83 def test_servername(self):84 files = self.storage.list_backups(servername='fooserver')85 for file in files:86 self.assertIn('fooserver', file)87 self.assertNotIn('barserver', file)88 files = self.storage.list_backups(servername='barserver')89 for file in files:90 self.assertIn('barserver', file)91 self.assertNotIn('fooserver', file)92 def test_content_type_media(self):93 files = self.storage.list_backups(content_type='media')94 for file in files:95 self.assertIn('.tar', file)96 # def test_servername(self):97 # files = self.storage.list_backups(servername='barserver')98 # for file in files:99 # self.assertIn('barserver', file)100class StorageGetLatestTest(TestCase):101 def setUp(self):102 self.storage = get_storage()103 HANDLED_FILES['written_files'] = [(f, None) for f in [104 '2015-02-06-042810.bak',105 '2015-02-07-042810.bak',106 '2015-02-08-042810.bak',107 ]]108 def tearDown(self):109 HANDLED_FILES.clean()110 def test_func(self):111 filename = self.storage.get_latest_backup()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful