From 7ecf6630c2b195ba14743d27deb19367ac303a0e Mon Sep 17 00:00:00 2001 From: Joerg Skottke Date: Fri, 20 Jun 2008 06:59:34 +0000 Subject: Add files that fit into the naming scheme --- .../tools/includes/optional/t_security_tools.inc | 670 +++++++++++++++++++++ 1 file changed, 670 insertions(+) create mode 100755 testautomation/global/tools/includes/optional/t_security_tools.inc (limited to 'testautomation/global/tools/includes/optional/t_security_tools.inc') diff --git a/testautomation/global/tools/includes/optional/t_security_tools.inc b/testautomation/global/tools/includes/optional/t_security_tools.inc new file mode 100755 index 000000000000..f4051a265aea --- /dev/null +++ b/testautomation/global/tools/includes/optional/t_security_tools.inc @@ -0,0 +1,670 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: t_security_tools.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsk $ $Date: 2008-06-20 07:58:56 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Tools to ease testing of security related funtionality +'* +'\****************************************************************************** + +function hSetPasswordRecommendation( bEnable as boolean ) as boolean + + '///

Toggle Tools/Options/OOo/Security: Password recommendation

+ '///Input: + '///
    + '///+
  1. Mode (boolean)
  2. + '///
      + '///+
    • TRUE: Switch password recommendation on
    • + '///+
    • FALSE: Switch password recommendation off
    • + '///
    + '///
+ + '///Returns: + '///
    + '///+
  1. Prior state (boolean)
  2. + '///
      + '///+
    • TRUE: Password recommendation was on
    • + '///+
    • FALSE: Password recommendation was off
    • + '///
    + '///
+ + '///Description: + '/// + +end function + +'****************************************************************************** + +function hOpenDigitalSignaturesDialog() as boolean + + '///

Open the Digital Signatures Dialog via File-Menu

+ '///Input: + '///
    + '///+
  1. Nothing
  2. + '///
+ + '///Returns: + '///
    + '///+
  1. Errorcondition (boolean)
  2. + '///
      + '///+
    • TRUE: The Digital Signatures Dialog is open
    • + '///+
    • FALSE: The Digital Signatures Dialog is not open
    • + '///
    + '///
+ + '///Description: + '/// + hOpenDigitalSignaturesDialog() = brc + +end function + +'******************************************************************************* + +function hAllowMacroExecution() as boolean + + '///

Allow macro execution on Macro Security Warning dialog

+ '///Input: + '///
    + '///+
  1. Nothing
  2. + '///
+ + '///Returns: + '///
    + '///+
  1. Errorcondition (boolean)
  2. + '///
      + '///+
    • TRUE: Macro dialog is open, successfully clicked "Run"
    • + '///+
    • FALSE: Dialog was not opened
    • + '///
    + '///
+ + '///Description: + '/// + +end function + +'******************************************************************************* + +function hDenyMacroExecution() as boolean + + '///

Deny macro execution on Macro Security Warning dialog

+ '///Input: + '///
    + '///+
  1. Nothing
  2. + '///
+ + '///Returns: + '///
    + '///+
  1. Errorcondition (boolean)
  2. + '///
      + '///+
    • TRUE: Macro dialog is open, successfully clicked "Deny"
    • + '///+
    • FALSE: Dialog was not opened
    • + '///
    + '///
+ + '///Description: + '/// + +end function + +'******************************************************************************* + +function hSwitchMacroSecurityTab( cTab as string ) + + '///

Switch between Security Level and Trusted Paths

+ '///Input: + '///
    + '///+
  1. The Tabpage to be activated (string). Valid options are:
  2. + '///
      + '///+
    • "SecurityLevel"
    • + '///+
    • "TrustedPaths"
    • + '///
    + '///
+ + '///Returns: + '///
    + '///+
  1. Nothing
  2. + '///
+ + '///Description: + '/// + +end function + +'******************************************************************************* + +function hAddTrustedPath( cPath as string ) as boolean + + '///

Add a directory to the list of trusted paths

+ '///Input: + '///
    + '///+
  1. Fully qualified path to the directory (string)
  2. + '///
+ + '///Return: + '///
    + '///+
  1. Errorcondition (boolean)
  2. + '///
      + '///+
    • TRUE = Path was successfully added
    • + '///+
    • FALSE = Failed to add the path
    • + '///
    + '///
+ + const CFN = "hAddTrustedPath::" + + dim iPathCount as integer + dim brc as boolean + + '///Description: + '/// + +end function + +'******************************************************************************* + +function hRemoveTrustedPath( cPath as string ) as boolean + + '///

Remove a directory from the list of trusted paths

+ '///Input: + '///
    + '///+
  1. Fully qualified path to the directory (string)
  2. + '///
+ + '///Return: + '///
    + '///+
  1. Errorcondition (boolean)
  2. + '///
      + '///+
    • TRUE = Path was successfully added
    • + '///+
    • FALSE = Failed to add the path
    • + '///
    + '///
+ + const CFN = "hRemoveTrustedPath()" + + dim iPathCount as integer + dim iCurrentPathItem as integer + + dim brc as boolean + brc = false + + '///Description: + '/// + +end function + + +'******************************************************************************* + +function hSecurityEnterPasswordOnSave( cPassword as string ) as boolean + + + '///

Enter password when saving a document

+ '///This function enters a password into the password dialog if the " + '///+ Save with password" checkbox is checked. It will automatically + '///+ generate a faulty password to be entered on first try (to see whether + '///+ the "Invalid password confirmation" dialog pops up, on second + '///+ attempt the password is confirmed correctly and thus the document should + '///+ save ok. The office should return to the document, the File Save dialog + '///+ should close after save.

+ + '///Parameter(s):
+ '///
    + + '///+
  1. Password to use (String)
  2. + '///
      + '///+
    • Password should contain strange characters and glyphs if possible
    • + '///
    + + '///
+ + + '///Returns:
+ '///
    + '///+
  1. Errorcondition (Boolean)
  2. + '///
      + '///+
    • TRUE if all went well
    • + '///+
    • FALSE on any error
    • + '///
    + '///
+ + const CFN = "hSecurityEnterPasswordOnSave::" + printlog( CFN & "Enter" ) + dim brc as boolean 'a multi purpose boolean returnvalue + brc = true + + '///Description: + '/// + + printlog( CFN & "Exit with result: " & brc ) + hSecurityEnterPasswordOnSave() = brc + +end function + + +'******************************************************************************* + +function hSecurityEnterPasswordOnLoad( cPassword as string, bValid as boolean ) as boolean + + use "global\tools\includes\optional\t_stringtools.inc" + + '///

Enter a password while loading a document

+ '///Enters a valid or invalid password while loading a passworded file

+ + '///Parameter(s):
+ '///
    + + '///+
  1. Password (String)
  2. + '///
      + '///+
    • The password should contain special characters and glyphs
    • + '///
    + + '///+
  3. Password validity (Boolean)
  4. + '///
      + '///+
    • TRUE: The password is correct, the document should load
    • + '///+
    • FALSE: The password is incorrect, the document should not load
    • + '///
    + + '///
+ + + '///Returns:
+ '///
    + '///+
  1. Errorcondition (Boolean)
  2. + '///
      + '///+
    • TRUE if the password protection worked as expected
    • + '///+
    • FALSE on any error
    • + '///
    + '///
+ + const CFN = "hSecurityEnterPasswordOnLoad::" + printlog( CFN & "Enter with option (Password): " & cPassword ) + printlog( CFN & "Enter with option (Validity): " & bValid ) + dim brc as boolean 'a multi purpose boolean returnvalue + brc = true + dim cMsg as string + + '///Description: + '/// + + printlog( CFN & "Exit with result:" & brc ) + hSecurityEnterPasswordOnLoad() = brc + +end function -- cgit v1.2.3