Arcyd-tester: Tester can wait one or more cycles
Arcyd-tester: Tester can wait one or more cycles

Add a new property - _has_enabled_count_cycles to the test Arcyd
instance which is not set by default but if set, Arcyd will wait for
one or more cycles (of one second each). The number of cycles is
controlled by an external report command count_cycles.sh which in turn
maintains the count in the file count_cycles.

Test plan:
$ ./precommit.sh

In function _do_tests() of py/ate/atecmd_arcydtester.py, add the
following lines at the start of try block:
    instance = fixture.arcyds[0]
    print(instance._has_enabled_count_cycles)
    instance.enable_count_cycles_script()
    print(instance._has_enabled_count_cycles)
    print(phlsys_fs.read_text_file(os.path.join(instance._root_dir, 'configfile')))
    phlsys_fs.write_text_file(os.path.join(instance._root_dir, 'cycle_counter'), '2')
    with phlsys_fs.chdir_context(instance._root_dir):
        os.system("./count_cycles.sh")
    print(instance.count_cycles())

Now, run the following command:

$ ./proto/arcyd-tester
Serving HTTP on 0.0.0.0 port 40606 ... # port number may vary
False # count_cycles disabled by deafult
True # count_cycles enabled by enable_count_cycles_script()
--arcyd-email
...
...
--external-report-command
count_cycles.sh # Correct script added as external report command
3 # Correct number of cycles counted (2 + 1).

aevri/phabricator-tools,cs-shadow/phabricator-tools,cs-shadow/phabricator-tools,cs-shadow/phabricator-tools,bloomberg/phabricator-tools,kjedruczyk/phabricator-tools,bloomberg/phabricator-tools,bloomberg/phabricator-tools,kjedruczyk/phabricator-tools,aevri/phabricator-tools,kjedruczyk/phabricator-tools,cs-shadow/phabricator-tools,bloomberg/phabricator-tools,aevri/phabricator-tools,kjedruczyk/phabricator-tools,aevri/phabricator-tools,aevri/phabricator-tools,bloomberg/phabricator-tools,kjedruczyk/phabricator-tools,cs-shadow/phabricator-tools