create_demo.py
The create_demo.py script is an interactive script that generates several scripts and data files you can use to create subscriber and pricing data, load it into the MATRIXX Engine databases, and pass event messages through the system. Use it to set field values in subscriber-related MDCs and to test and demonstrate MATRIXX functionality.
Name
create_demo.py
Syntax
create_demo.py -h | -c | -d | --debug_seagull_parsing | i input_directory | -use_default_values
Options
- -h
- Displays help
information for this script.
Note: After running the script, enter ? in response to a question to display specific information about that question.
- -c
- Runs the create_config.py script, which is called by the create_demo.py script, in debug mode. If this option is specified, more messages are returned to help in debugging.
- -d
- Runs the demo creation in debug mode. If this option is specified, more messages are returned to help in debugging.
- --debug_seagull_parsing
- Runs the create_demo.py script with the debug Seagull parsing flag. If this option is specified, more messages are returned to help in debugging during the parsing of a Seagull scenario file to help in debugging.
- -i input_directory
- Identifies the directory that has one or more input files to use when creating the demo. When not specified, the current directory is used. Multiple input directories can be used and are processed in the order specified. When checking the input directories, all input files found are processed as if they were concatenated together. Multiple directories can be specified, each one with an -i option. All input files are treated as optional when the directories are searched. As an input filename is processed, all directories are used to find one or more matching files. Each input directory might contain zero or more input files. The names of the files used are displayed as they are being processed. If a directory does not have the specific file, then the file is ignored.
- --remove_duplicate_lines
- If specified, input files that have lines that duplicate lines from earlier files are removed.
- --update_changed_lines
- If specified, all input files that have a reworded question are updated. Otherwise, this is done only in the last input file.
- --update_dir=UPDATE_DIR
- Specifies the update directory (default=). This is only valid if the
-i <dir>
syntax is specified. By default, when input directories are specified, no input file is changed. Any re-worded questions or duplicates are not remembered. To save these changes, specify the directory in which to save them. This must be one of the-i
directories. - --use_default_values
- Uses the default values (if a default value exists) for any create_demo.info questions that have not been answered.
Input Files
create_demo.info
The create_demo.info
file has a number
of questions with answers that configure the data and operational aspects for a particular
test scenario. For example, the number of subscribers to create, the number of product
offers to assign to subscribers, whether to set up groups, and various network usage details
for the Seagull event simulator.
For more information about the MATRIXX environment variables, see the discussion about container directories and environment variables in MATRIXX Installation and Upgrade.
Output Files
The create_demo.py script collects the required input data and stores it in Python dictionaries. It generates the following data files based upon these dictionaries. These data files are used by the supporting scripts in the following list to determine what to do. Two versions of the data exist. The *.data files contain the key and string value of each dictionary element sorted by key. The *.pickled files contain the dictionaries in Python pickle format which is easier for Python scripts to use.
- create_config.data — This file has the information collected by create_config.py.
- create_config.pickled — This file has the same data as create_config.data except it is in the Python pickle format.
- create_demo.data — This file has the information collected by create_demo.py.
- create_demo.pickled — This file has the same data as create_demo.data except it is in the Python pickle format.
Generated Scripts
-
run_test.py
This script uses all files created by the create_demo.py script and calls all related scripts to run a complete demonstration of the MATRIXX Charging Application.
The create_demo.py script creates one or more tests named run_test#.py, where # is a test number, for example run_test1.py. Each run_test#.py script can call a different specified script, instead of calling all scripts like the run_test.py script. Each run_test#.py script created by the create_demo.py script can test a specific functionality of a running server, without having to stop, restart, and load data before calling the script.
Supporting Scripts
The run_test.py script that is
created by create_demo.py might use any of the following scripts
that used the *.data
or *.pickled
data files that
were generated.
- create_subscriber_data.py
This script runs create_subscriber_data_set.py once for each set of subscribers that was specified in the create_demo.info file. Each set of subscribers is created by a single process.
-
create_subscriber_data_set.py
This script creates the files containing the number of subscribers requested, including their devices, services, phone numbers, product offers, wallets, and associated time zone. These files add required balances, including credit limits and thresholds, to their wallets, add subscribers to groups, and identify a group administrator.
- load_subscribers.py
This script takes the data created by the create_subscriber_data.py script and loads into MATRIXX Charging Application.
-
create_seagull_t1_1_info.py
This script creates variable event data read by Seagull when Seagull is chosen as the data traffic generation method. You can have more than one Seagull instance running in each test. The script generates the following input files, where the number after the
t
is the test number and the second number is the Seagull instance:- seagull_t1_1_data.csv – A file that has data, such as unique phone numbers, for each subscriber created.
- seagull_t1_1_data.csv – A file containing
sed
commands that change the data contained in the seagull_t1_1_data.csv file. This is empty by default. - seagull_test_params.py – A script that the create_seagull_info.py script uses to generate parameters used to test incoming event packets.
- seagull_t1_1_conf_client_xml.sed – A file
containing
sed
commands that change the default Seagull configurations defined in the seagull_conf_client.xml file. This file is empty by default. - seagull_t1_1_dictionary_base_cc_xml.sed –
A file containing
sed
commands that change the seagull_t1_1_dictionary_base_cc.xml file. This file is empty by default.
If you do not select Seagull as the data method, the create_demo.py script prompts you for a specific script to run and the name of the test that runs it.