Menu

#1325 TestPython.py fails

Unix
closed-fixed
5
2010-02-22
2010-02-04
No

TestPython.py script which is provided by staf source to test Python binding is failing.
STAF v 3.4.0
Python v2.6.1
OpenSolaris x86 2009.06

Discussion

  • Semih Cemiloglu

    Semih Cemiloglu - 2010-02-04

    Log file showing errors

     
  • David Michael Bender

    • labels: --> Lang::Python
    • assigned_to: nobody --> dave2268
     
  • David Michael Bender

    • milestone: --> Unix
    • status: open --> closed-fixed
     
  • David Michael Bender

    Here is the error you get on Unix platforms:

    ERROR: Returned data not same as original stdout file contents
    Expected:
    @SDT/{:177::2:RC@SDT/$S:1:0:6:IPInfo@SDT/$S:36:9.42.126.76x255.255.252.0
    x9.42.124.1:3:Msg@SDT/$S:46:Static IP arguments are processed
    successfully:9:Timestamp@SDT/$S:19:2009-01-16 14:41:45
    Found:
    @SDT/{:177::2:RC@SDT/:1:0:6:IPInfo@SDT/:36:9.42.126.76x255.255.252.0x9.4
    2.124.1:3:Msg@SDT/:46:Static IP arguments are processed
    successfully:9:Timestamp@SDT/:19:2009-01-16 14:41:45

    The Unix shell is stripping off the $S in the "echo" request, which is causing the failure.

    Note that you may still get errors in the privacy delimiter tests. These are not Python-specific errors, so we have opened the following bug:
    Bug #2956760: STAFAddPrivacyDelimiters sometimes returns incorrect data

    Here is a cvs diff of the changes:

    Index: TestPython.py

    RCS file: /cvsroot/staf/src/staf/lang/python/TestPython.py,v
    retrieving revision 1.13
    diff -r1.13 TestPython.py
    87a88,102
    > # Get OS Name
    >
    > print "Resolving STAF/Config/OS/Name"
    >
    > result = handle.submit("local", "var", "resolve string {STAF/Config/OS/Name}")

    >
    > if (result.rc != STAFResult.Ok):
    > print "Error resolving STAF/Config/OS/Name, RC: %d, Result: %s" % \ > (result.rc, result.result)
    > sys.exit(result.rc)
    >
    > print "OS is %s" % (result.result)
    >
    > windowsOS = result.result.lower().startswith("win")
    >
    766a782,784
    > if not windowsOS:
    > data = data.replace('$', '\\\$')
    >
    789a808,810
    > if not windowsOS:
    > data = data.replace('$', '\\\$')
    >

    Index: History

    RCS file: /cvsroot/staf/src/staf/History,v
    retrieving revision 1.874
    diff -r1.874 History
    55a56
    > + Fixed errors when running TestPython.py on Unix (Bug #2945603)

     

Log in to post a comment.