messagingfw/msgtestfw/TestCases/ScriptedTestCases/Capabilities/Cap_EMsvOpenAttachment.script
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 //
       
     2 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 //
       
     9 // Initial Contributors:
       
    10 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description:
       
    15 //
       
    16 
       
    17 PRINT Running  EMsvOpenAttachment
       
    18 
       
    19 //******************************************
       
    20 // Entry is not owned by us.
       
    21 // Need ReadUserData to access the entry.
       
    22 //******************************************
       
    23 
       
    24 PRINT Running  EMsvOpenAttachment : Read Caps = ReadUserData. Different SID. Should Pass.
       
    25 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_Setup.script
       
    26 
       
    27 RUN_PROGRAM -1 setcap MessagingTestServer_caps.exe 0003fffe -SID 101F7776 MessagingTestServer.exe
       
    28 
       
    29 // First need to create the attachment. Run proxy with same SID as test server.
       
    30 RUN_PROGRAM -1 setcap SendProxyServer_caps.exe 00000000 -SID 101F7776 SendProxyServer.exe
       
    31 	
       
    32 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_CreateSingleEntryInbox.script
       
    33 
       
    34 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_SendEMsvCreateAttachmentForWrite_Pass.script
       
    35 
       
    36 // Need to wait for the proxy server to die
       
    37 DELAY 3000
       
    38 
       
    39 // Now we try to open the attachment using ReadUserData and different SID.
       
    40 RUN_PROGRAM -1 setcap SendProxyServer_caps.exe 00008000 -SID 101F7777 SendProxyServer.exe
       
    41 
       
    42 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_SendEMsvOpenAttachment_Pass.script
       
    43 
       
    44 // Need delay to allow SendProxyServer shutting down
       
    45 DELAY 3000
       
    46 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_Restore.script
       
    47 
       
    48 //******************************************
       
    49 // Entry is not owned by us.
       
    50 // Need ReadUserData to access the entry.
       
    51 //******************************************
       
    52 
       
    53 PRINT Running  EMsvOpenAttachment : Read Caps = 0. Different SID. Should Fail.
       
    54 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_Setup.script
       
    55 
       
    56 RUN_PROGRAM -1 setcap MessagingTestServer_caps.exe 0003fffe -SID 101F7776 MessagingTestServer.exe
       
    57 
       
    58 // First need to create the attachment. Run proxy with same SID as test server.
       
    59 RUN_PROGRAM -1 setcap SendProxyServer_caps.exe 00000000 -SID 101F7776 SendProxyServer.exe
       
    60 	
       
    61 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_CreateSingleEntryInbox.script
       
    62 
       
    63 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_SendEMsvCreateAttachmentForWrite_Pass.script
       
    64 
       
    65 // Need to wait for the proxy server to die
       
    66 DELAY 3000
       
    67 
       
    68 // Now we try to open the attachment using no capabilities and different SID.
       
    69 RUN_PROGRAM -1 setcap SendProxyServer_caps.exe 00000000 -SID 101F7777 SendProxyServer.exe
       
    70 
       
    71 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_SendEMsvOpenAttachment_Fail.script
       
    72 
       
    73 // Need delay to allow SendProxyServer shutting down
       
    74 DELAY 3000
       
    75 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_Restore.script
       
    76 
       
    77 
       
    78 //******************************************
       
    79 // Entry is owned by us.
       
    80 // Need no capabilities to access the entry.
       
    81 //******************************************
       
    82 
       
    83 PRINT Running  EMsvOpenAttachment : Read Caps = 0. Same SID. Should Pass.
       
    84 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_Setup.script
       
    85 
       
    86 RUN_PROGRAM -1 setcap MessagingTestServer_caps.exe 0003fffe -SID 101F7776 MessagingTestServer.exe
       
    87 
       
    88 RUN_PROGRAM -1 setcap SendProxyServer_caps.exe 00000000 -SID 101F7776 SendProxyServer.exe
       
    89 	
       
    90 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_CreateSingleEntryInbox.script
       
    91 
       
    92 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_SendEMsvCreateAttachmentForWrite_Pass.script
       
    93 
       
    94 // Need to wait for the proxy to die, else we get a KErrInUse.
       
    95 DELAY 3000
       
    96 
       
    97 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_SendEMsvOpenAttachment_Pass.script
       
    98 
       
    99 // Need delay to allow SendProxyServer shutting down
       
   100 DELAY 3000
       
   101 RUN_SCRIPT  c:\msgtest\TestFramework\ScriptedTestCases\Capabilities\Cap_Restore.script