apiVersion: api/v1
kind: Case
name: lightning_import_table_with_placement
features: [ lightning ]
summary: Lightning import table with placement policies configured
steps: |
    1. Import data with placement policy configured. (the create table ddl contains placement policy)

expectedResult:
    1. Import should fail if target tidb doesn't have the placement policy defined.
    (though the source data contains CREATE PLACEMENT POLICY DDL, lightning doesn't support to create it now).
    2. Import should succeed if target tidb,
    1), tidb_enable_alter_placement enabled (only for 5.4.0, it is always on after 5.4.0)
    2), with placement policy defined and valid store match it.

category: FUNCTIONALITY
priority: P1
supportedVersions: [ ">=5.4" ]
tags: [ "lightning", "acceptance" ]
designer: zhangfubin@pingcap.com
automation: AUTOMATED
active: true
framework:
    generic:
        command: [ "/importPlacement" ]
        workingDir: "/"
        env: null
        image: hub-new.pingcap.net/fubinzhang/lightning-placement
        imagePullPolicy: "Always"
parameters:
    -   type: RESOURCE
        name: target
        default: target
    -   type: RESOURCE
        name: lightning
        default: lightning
    -   type: STRING
        name: import_basic_opts
        default: |
            {"data-dir":"s3://nfs/tools_test_data/placement_test_dumpling?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","backend":"local","sorted-kv-dir":"/tmp/sorted-kv-dir", "timeout":"10m","crc32-checksum":4156737264, "transfer-to-config": true}
    -   type: STRING
        name: drop_databases
        default: placement_test
    -   type: STRING
        name: admin_check
        default: '[]'