// Module included in the following assemblies:
//
// * backup_and_restore/application_backup_and_restore/oadp-data-protection-test.adoc

:_mod-docs-content-type: PROCEDURE
[id="oadp-dpt-use-case-bsl-spec_{context}"]
= Running a data protection test by configuring a backup storage location specification

[role="_abstract"]
Configure and run the `DataProtectionTest` (DPT) custom resource (CR) by specifying an inline backup storage location (BSL) specification instead of referencing an existing BSL name. This helps you test data upload performance and CSI snapshot readiness without creating a separate BSL resource.

.Prerequisites

* You have logged in to the {product-title} cluster as a user with the `cluster-admin` role.
* You have installed the OpenShift CLI (`oc`).
* You have installed the {oadp-short} Operator.
* You have created the `DataProtectionApplication` (DPA) CR.
* You have configured a bucket to store the backups.
* You have created the `Secret` object to access the bucket storage.
* You have an application with persistent volume claims (PVCs) running in a separate namespace.


.Procedure

.  Create a manifest file for the DPT CR as shown in the example:
+
[source,yaml]
----
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionTest
metadata:
  name: dpt-sample
  namespace: openshift-adp
spec:
  backupLocationSpec:
    provider: aws
    default: true
    objectStorage:
      bucket: sample-bucket
      prefix: velero
    config:
      region: us-east-1
      profile: "default"
      insecureSkipTLSVerify: "true"
      s3Url: "https://s3.amazonaws.com/sample-bucket"
    credential:
      name: cloud-credentials
      key: cloud
  uploadSpeedTestConfig:
    fileSize: 50MB
    timeout: 120s
  csiVolumeSnapshotTestConfigs:
    - volumeSnapshotSource:
        persistentVolumeClaimName: mongo
        persistentVolumeClaimNamespace: mongo-persistent
      snapshotClassName: csi-snapclass
      timeout: 2m
  forceRun: true
  skipTLSVerify: true
----
+
where:
+
`backupLocationSpec`:: Configures the BSL spec by specifying details such as the cloud provider.
`sample-bucket`:: Specifies the bucket name. In this example, the bucket name is `sample-bucket`.
`us-east-1`:: Specifies the cloud provider region.
`credential`:: Specifies the cloud credentials for the storage bucket.
`uploadSpeedTestConfig`:: (Optional) Configures the upload speed test by setting the `fileSize` and `timeout` fields.
`csiVolumeSnapshotTestConfigs`:: Configures the CSI volume snapshot test.
`skipTLSVerify`:: Set to `true` to skip the TLS certificate validation during the DPT CR run.

. Create the DPT CR by running the following command:
+
[source,terminal]
----
$ oc create -f <dpt_file_name>
----
+
Replace `<dpt_file_name>` with the file name of the DPT manifest.


.Verification

. Verify that the phase of the DPT CR is `Complete` by running the following command:
+
[source,terminal]
----
$ oc get dpt dpt-sample
----
+
The example output is as following:
+
[source,terminal]
----
NAME         PHASE      LASTTESTED   UPLOADSPEED(MBPS)   ENCRYPTION   VERSIONING   SNAPSHOTS    AGE
dpt-sample   Complete   17m          546                 AES256       Enabled      2/2 passed   17m
----
