This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/systemd-sonic-generator/tests/testfiles/multi_inst_a@.service
anamehra 4f8dec9a6f
[multi-asic] Fixed systemd-sonic-generator for multi-asic (#7633)
* Fixed systemd-sonic-generator for multi-asic

    1. In function insert_instance_number instance_string was malloced for 2 char
       size which was limiting the instance number value in instance_name to 1 digit.
       Fixed insert_instance_number to use asprintf to generate instancd_name for
       any number of instances. Added _GNU_SOURCE to CFLAGS for asprintf.

    2. Fixed get_unit_files() to use calloc instead of malloc. Uninitialized memory
       was causing incorrect string mismatch error while comparing unit file name
       string.

    3. Increased MAX_NUM_TARGETS and MAX_NUM_INSTALL_LINES values to 48 to handle more
       asic instances.

    4. Added build UT support for systemd-sonic-generator:
        a. Refactor systemd-sonic-generator.c to be used with UT infra.
        b. Added UT infra to run build UT for systemd-sonic-generator
        c. Added functional level and program level UT class and test cases.

* Resolved review comments.

    1. Explicitly setting global pointers to NULL in definitions.
    2. Added a space before ": public" in class definitions to align style
       with SONiC C++ files.

* Merged strtok_r statements in single command.

Signed-off-by: Anand Mehra <anamehra@cisco.com>
2021-05-28 13:20:11 -07:00

14 lines
242 B
Desktop File

[Unit]
Description=Multi INstance A test Service
After=multi_inst_a.service
StartLimitIntervalSec=1200
StartLimitBurst=3
[Service]
User=root
ExecStop=/usr/bin/test.sh stop %i
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target