Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

@dawagner
Copy link
Contributor

@dawagner dawagner commented Jul 8, 2015

  • Remove some dead code and simplify some code portions.
  • Add a new feature: pass more than one '--scenario' option.
  • Remove the SetupScript config item (if you need a setup script, you need to run it by yourself)
  • The TestPlatformHost and ParameterFrameworkHost config items used to contain both the hosts and the ports; replace them with TestPlatformPort and ParameterFramworkPort that contain only the port. The host wil always be localhost anyway - no need to define it.
  • Remove the RemoteProcessCommand and TestPlatformCommand config items and expect remote-process and test-platform to be in the PATH.
  • Make some config items optional.
  • Make all paths in conf.json relative to the test directory (but obsolute paths will really be considered absolute).

@dawagner dawagner force-pushed the client-simulator-rework branch 2 times, most recently from 1b2913d to bfee06e Compare July 9, 2015 13:01
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the typo should be corrected : Framwork/Framework

@dawagner dawagner force-pushed the client-simulator-rework branch from bfee06e to ffea2a7 Compare July 10, 2015 08:53
@dawagner
Copy link
Contributor Author

@dpertuze the "ParameterFramworkPort" config item wasn't even used... So I removed it and pushed a new version. Thanks for catching it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this actual version, if the user wants to get to the menu, no_exit option must be put on the command line, which does not seem natural for me...

@dawagner dawagner force-pushed the client-simulator-rework branch from ffea2a7 to 9910d67 Compare July 13, 2015 13:06
@dawagner
Copy link
Contributor Author

@dpertuze done.

Some paths were concatenated by inserting a "/" between the two components.
This is not portable and also makes it impossible to handle absolute paths.
Instead, os.path.join is both portable and "smart" about absolute paths:

    os.path.join("foo/bar", "/spam") == "/spam"

Signed-off-by: David Wagner <david.wagner@intel.com>
@dawagner dawagner force-pushed the client-simulator-rework branch from 9910d67 to baa22cf Compare July 15, 2015 12:40
dawagner added 13 commits July 15, 2015 14:41
This simply was dead code.

Signed-off-by: David Wagner <david.wagner@intel.com>
They were dead code.

Signed-off-by: David Wagner <david.wagner@intel.com>
Such unecessarily wide blocks make the code harder to read.

Signed-off-by: David Wagner <david.wagner@intel.com>
The sorted() function already returns a strict list (i.e. not a generator or
other such lazy iterable). Thus this identity list-comprehension:

    [i for i in sorted(x)]

is useless and can be rewritten as:

    sorted(x)

Signed-off-by: David Wagner <david.wagner@intel.com>
And avoid modifying UserInteractor.getMenu's input argument.

Signed-off-by: David Wagner <david.wagner@intel.com>
A bare string statement at the beginning of a class or a function is evaluated
as a docstring but it makes no sense at the beginning of an if-clause. Change
it to a comment instead.

Signed-off-by: David Wagner <david.wagner@intel.com>
remote-process and test-platform should simply be in the PATH and so, there is
no need for their paths to be put in conf.json. This change is somewhat
backward-compatible because these configuration items will simply be ignored.

Another reason why it wasn't very useful for these paths to be in conf.json is
that, even if their path is know, one still has to add their library's path to
LD_LIBRARY_PATH. It is easier to install the Parameter Framework project, in
order to have everything set.

Signed-off-by: David Wagner <david.wagner@intel.com>
…dlers host

The configuratio item "TestPlatformHost" is replaced by "TestPlatformPort"
while "ParameterFramworkHost" is completely removed (it wasn't used).  It made
no sense to specify the host since it couldn't have been anything else than
"localhost".

This change isn't backward-compatible since configuration files need to be
changed.

Signed-off-by: David Wagner <david.wagner@intel.com>
Since this script is only run once in the entire lifetime of a Client Simulator
instance ( before running the scenarios), it can simply be manually executed by
the user.

Signed-off-by: David Wagner <david.wagner@intel.com>
Now, all paths in conf.json must be absolute or relative to the test directory.

This harmonizes all the paths and avoids describing special cases. Also, there
was a mistake in documentation regarding how the "LogFile" path is evaluated.

Signed-off-by: David Wagner <david.wagner@intel.com>
ScriptsFile, ActionGathererFile, LogFile, CoverageFile, CoverageDir and
PfwDomainConfFile are now optional and can be left out of conf.json.

Signed-off-by: David Wagner <david.wagner@intel.com>
Dicts had no added value over lists since menus are a) sorted and b) indexed by
a number. Using lists instead simplifies the code a bit.

Signed-off-by: David Wagner <david.wagner@intel.com>
Each menu entry used to say "<script name> scripts". There was a typo (plural)
and it wasn't looking the same as other menus that were in the form "<verb>
<noun>".

Change the entries to "Execute <script name>".

Signed-off-by: David Wagner <david.wagner@intel.com>
@dawagner dawagner force-pushed the client-simulator-rework branch from baa22cf to abece42 Compare July 15, 2015 13:40
Client Simulator only supports one scenario to be launched by
command line option.

For automation purpose, this patch adds an option allowing the user
to specify several scenarios on command line.

Also, the default behaviour used to be: "after a scenario has been executed,
present the user with a menu in order to run more of them". The new behaviour
is to exit the Client Simulator after the scenarios have been run; the old
behaviour can be reproduced with the new "--no-exit" option.

If neither --scenario nor --interactive nor --no-exit are passed, then the same
behaviour as with --no-exit is applied.

Change-Id: I0ea64a2576c390d0b80b825b9f3f320ce9e8da43
Signed-off-by: David Pertuze <davidx.pertuze@intel.com>
Signed-off-by: David Wagner <david.wagner@intel.com>
@clero
Copy link
Contributor

clero commented Jul 15, 2015

👍

@sguiriec
Copy link

Tested-by: Sebastien Guiriec sebastien.guiriec@intel.com

dawagner added a commit that referenced this pull request Jul 20, 2015
Some Client Simulator reworks

- Remove some dead code and simplify some code portions.
-  Add a new feature: pass more than one '--scenario' option.
- Remove the SetupScript config item
  (if you need a setup script, you need to run it by yourself)
- The TestPlatformHost and ParameterFrameworkHost config
  items used to contain both the hosts and the ports; replace them
  with TestPlatformPort and ParameterFramworkPort that contain
  only the port. The host will always be localhost anyway - no need
  to define it.
- Remove the RemoteProcessCommand and
  TestPlatformCommand config items and expect remote-process
  and test-platform to be in the PATH.
- Make some config items optional.
- Make all paths in conf.json relative to the test directory
  (but absolute paths will really be considered absolute).

Tested-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
@dawagner dawagner merged commit 9c54ad6 into intel:master Jul 20, 2015
@dawagner dawagner deleted the client-simulator-rework branch July 20, 2015 08:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants