apiVersion: api/v1
kind: Case
name: lightning_import_placement_mode
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 TIDB_PLACEMENT_MODE = STRICT and 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 TIDB_PLACEMENT_MODE = IGNORE and have the placement policy defined, placement options are ignored after import.
    3. Import should succeed if target tidb TIDB_PLACEMENT_MODE = STRICT and have the placement policy defined, placement options are imported.
    4. Import should succeed if target tidb TIDB_PLACEMENT_MODE = IGNORE and have the placement policy defined,  placement options are ignored after import.

category: FUNCTIONALITY
priority: P1
supportedVersions: [ ">=6.0" ]
tags: [ "lightning", "acceptance" ]
designer: zhangfubin@pingcap.com
automation: AUTOMATED
active: true
framework:
    generic:
        command: [ "/importPlacementMode" ]
        workingDir: "/"
        defaultTimeout: 600
        env: null
        image: hub-new.pingcap.net/fubinzhang/lightning-placement-mode
        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: '[]'
    -   type: STRING
        name: check_placement_options_tables
        default: |
            {"tables": ["placement_test.t1"]}