nasa / CTF

This is a new repository for a new tool to be added to the cFS ecosystem called cFS Test Framework (CTF).
27 stars 6 forks source link

Accessing cfs_build_dir from CTF script #51

Closed buerge3 closed 10 months ago

buerge3 commented 1 year ago

I want to use CopyFiles instruction to copy a file to the cfs_run_dir. Right now cfs_run_dir is not a variable, so I would have to change my script every time to use a different config INI. Instead, I would like to be able to do something like this from within my CTF scripts:

            {
                "instruction": "CopyFiles",
                "description": "Step 1.1: Make backups of the CFE tables that will be changed",
                "data": {
                    "source": "${vsm1:cfs_build_dir}/cf/executive_config.tbl",
                    "destination": "${vsm1:cfs_build_dir}/cf/executive_config.tbl~"
                }
            },
            {
                "instruction": "CopyFiles",
                "description": "Step 1.1: Make backups of the CFE tables that will be changed",
                "data": {
                    "source": "${vsm1:cfs_build_dir}/cf/planner_goals.tbl",
                    "destination": "${vsm1:cfs_build_dir}/cf/planner_goals.tbl~"
                }
            },
            {
                "instruction": "CopyFiles",
                "description": "Step 1.1: Make backups of the CFE tables that will be changed",
                "data": {
                    "source": "${vsm1:cfs_build_dir}/cf/planner_config.tbl",
                    "destination": "${vsm1:cfs_build_dir}/cf/planner_config.tbl~"
                }
            },

And have it actually work, be able to resolve the variable according to the specified target in the INI file.

blueoceanwater commented 11 months ago

the syntax "${vsm1:cfs_build_dir}/cf/planner_config.tbl" does not follow variable evaluation syntax $variable$, would an alternative work?

  1. define a use variable in INI vsm1_cfs_build_dir
  2. refer it in instructions like "source": "$vsm1_cfs_build_dir$/cf/planner_config.tbl",