16
Windows Backup Manual Test Cookbook Last updated: 11/17/2009 Overview............................................................. 2 WSB Manual Tests (As per Sub Areas listed in WTT)...................2 WCB Manual Tests (As per Sub Areas listed in WTT)...................3 ASR Manual Tests....................................................3 Glossary............................................................. 3 Lab Infrastructure................................................... 4 Network Diagram.....................................................4 Common Configuration/Provisioning...................................4 Resources...........................................................4 Hardware Requirements...............................................4 Software Requirements................................................ 5 Test Tools/Methods..................................................5 BitLocker.........................................................5 Disk Management MMC...............................................5 Diskpart Command..................................................5 Simbad Tool.......................................................6 Group Policy Editor (GPEDIT.MSC)..................................6 DVD Test Hook.....................................................6 HE Tool...........................................................6 SFPCopy...........................................................6 ICALCS Tool.......................................................7 MkLink............................................................7 Attrib............................................................7

Win 7 COOKBOOK

Embed Size (px)

DESCRIPTION

Sneak Peek into what Win 7 IS ALL ABOUT

Citation preview

Page 1: Win 7 COOKBOOK

Last updated: 11/17/2009

Overview.....................................................................................................................................................2

WSB Manual Tests (As per Sub Areas listed in WTT)...............................................................................2

WCB Manual Tests (As per Sub Areas listed in WTT)...............................................................................3

ASR Manual Tests....................................................................................................................................3

Glossary.......................................................................................................................................................3

Lab Infrastructure........................................................................................................................................4

Network Diagram....................................................................................................................................4

Common Configuration/Provisioning......................................................................................................4

Resources................................................................................................................................................4

Hardware Requirements.........................................................................................................................4

Software Requirements...............................................................................................................................5

Test Tools/Methods.................................................................................................................................5

BitLocker..............................................................................................................................................5

Disk Management MMC......................................................................................................................5

Diskpart Command..............................................................................................................................5

Simbad Tool.........................................................................................................................................6

Group Policy Editor (GPEDIT.MSC).......................................................................................................6

DVD Test Hook.....................................................................................................................................6

HE Tool................................................................................................................................................6

SFPCopy...............................................................................................................................................6

ICALCS Tool..........................................................................................................................................7

MkLink.................................................................................................................................................7

Attrib....................................................................................................................................................7

Other Inbox Tools................................................................................................................................8

Other Tools Usage Info required in execution of Manual tests...........................................................8

How to make a volume critical in Client..........................................................................................8

How to make a volume critical in Server.........................................................................................8

Page 2: Win 7 COOKBOOK

Using the “Vshadow.exe” and “Vssadmin” utility............................................................................9

How to collect VSS traces................................................................................................................9

How to simulate disk failure..........................................................................................................10

Test hook for disable and enable system writer............................................................................10

To separate system volume and boot volume...............................................................................10

How to make the volume dirty......................................................................................................10

Prerequisite knowledge.............................................................................................................................10

Specific Component knowledge................................................................................................................11

Windows Backup Diagnostic Information..............................................................................................11

Diagnosing Backup Failures.......................................................................................................................12

WBDiag Tracing Tool..............................................................................................................................12

Log Parsing Tool.....................................................................................................................................12

File System Concepts.................................................................................................................................12

ACL’s......................................................................................................................................................12

File Attributes........................................................................................................................................12

Reparse Point........................................................................................................................................13

VHD.......................................................................................................................................................13

OverviewHigh-level overview of the manual cases, for example the bucket of manual test and its priority (IDX/FTP).

WTT jobs for manual tests of Windows Backup(Windows Server Backup(WSB) as well as Windows Client Backup(WCB)) are present in LHSB datastore under “$\WIN7\Server-SSD\Data Lifecycle Mgmt” path. Following paths are of interest:-

1. WSB Manual Tests WTT Jobs --“$\WIN7\Server-SSD\Data Lifecycle Mgmt\Server Backup\Tests”2. WCB Manual Tests WTT Job--“$\WIN7\Server-SSD\Data Lifecycle Mgmt\Client Backup\Tests”3. ASR Manual Tests WTT Jobs--“$\WIN7\Server-SSD\Data Lifecycle Mgmt\ASR\Tests”

WSB Manual Tests (As per Sub Areas listed in WTT)Features/Sub Areas # of test cases Priority CommentsBare Metal Recovery 3 IDX P1 testsBLB Engine 40 IDX P1 testsCommand Line 6 IDX P1 testsUser Interface 7 IDX P1 tests

Page 3: Win 7 COOKBOOK

Command Line 104 Once per milestone P2 testsBLB Engine 212 Once per milestone P2 testsBare Metal Recovery 9 Once per milestone P2 testsUser Interface 92 Once per milestone P2 testsSetup 6 Once per milestone P2 testsTotal 479(56 IDX + 423

Others)

WCB Manual Tests (As per Sub Areas listed in WTT)Features/Sub Areas # of test cases Priority CommentsComplete PC Backup 21 IDX 9 P0 + 12 P1 testsSafedocs 133 IDX 12 P0 + 121 P1 testsSystem Restore 19 IDX 2 P0 + 17 P1 testsComplete PC Backup 32 Once per milestone P2 testsSafedocs 249 Once per milestone P2 testsSystem Restore 50 Once per milestone P2 testsTotal 504 (173 IDX + 331

Others)

ASR Manual TestsFeatures/Sub Areas # of test cases Priority CommentsASR 1 IDX 1 P1 testASR 1 Once per milestone 1 P2 test

GlossaryList the abbreviations, terms and definitions that are used in WTT job descriptions

Term ExplanationASR Automated System Recovery[Basic feature providing disk

information backup/recovery]BMR Bare Metal Recovery [Backup feature built on top of ASR to

provide full system recovery from disk crash]FLB File Level BackupBLB Block Level BackupWCB Windows Client Backup (referring to Vista/Win7 Backup)WSB Windows Server BackupWBToolsShare Windows Backup tools share.blbtest Windows Backup Test installation Directory. Resides on

%SystemDrive%. Contains most of the test tools/automation.VHD Virtual Hard Disk…..

Page 4: Win 7 COOKBOOK

Lab Infrastructure

Network DiagramSince Windows Backup is a one node solution, no special setup is required for manual testing (apart from test specific hardware requirements).

Common Configuration/ProvisioningFollowing basic configuration is required before running the test.

1. Install Backup Features on the test machine.2. Install test tools on the test machines.

Refer “Guide on WSB Manual Tests Execution” for more details.

ResourcesWCB and WSB manual test execution guides will help tester to get to speed on features in WSB and WCB to run manual tests. It gives brief overview about the backup design, UI, and test installation. It is highly suggested that you go through these documents before continuing.

Following set of documents are required for understanding backup feature and different testing aspects.

1. Basic documentation on specific features [MUST READ]a. Guide on WSB Manual Test Executionb. WCB How to For Manual Test Execution

2. Test specific deployment guidesa. How to run WSB tests on ISCSI Disksb. How to Setup Active Directoryc. How to Setup Cluster Service

Besides above general information documents, each manual test case in WTT provides required details for manual execution.

Apart from the documents backup testing would require certain tools which will be shared with you in a network share [WBToolsDirectory]

Hardware Requirements

Hardware

Most of the WSB tests need one Windows Server 2008 R2 machine with one disk free (internal or external based on test). Some tests require multi-machine (mostly 2 machines). Exact requirements are mentioned in each test in WTT in LHSB datastore under “$\WIN7\Server-SSD\Data Lifecycle Mgmt\Server Backup” path

Page 5: Win 7 COOKBOOK

Most of the WCB tests need Windows 7 Machine with one free disk. Exact requirement is mentioned in each test in WTT in LHSB datastore under “$\WIN7\Server-SSD\Data Lifecycle Mgmt\Client Backup\Tests” path.

Special hardware/device

External Disks Removable Media based Device Prostor DVD Drive and Media Shared storage (ISCSI) for Cluster testing

Other specific hardware requirements are mentioned in WTT jobs.

Software Requirements Below is the list of tools used for testing Windows Backup.

Test Tools/Methods

BitLockera) Install BitLocker from “Server Manager” UI.b) Reboot machinec) Sample command to bitlock volume X:

manage-bde -on X: -RecoveryPassword -Recoverykey Y:\

d) Sample command to unlock volume X:manage-bde -unlock X: -RecoveryKey Y:\aaa.bek

Disk Management MMCa) For attaching/detaching virtual disks

Use Action->Attach VHD.b) For creating/deleting volumes

i) For creating a new volume, right click on the disk and click “New Simple Volumej”

ii) For creating a dynamic volume, right click on the disk and click “New Spanned Volume” or “New Mirrored Volume” or “New Striped Volume” or “New RAID-5 Volume”

iii) For deleting a volume, right click on the volume and click delete. c) By default, a disk is a basic disk. For converting a disk to dynamic, select a disk, right click on

the disk and click “Convert to Dynamic Disk”. For converting it back to basic, you will have to delete all volumes on it. Then, right click on the disk and click “Convert to Basic Disk”

Page 6: Win 7 COOKBOOK

Diskpart Command Type diskpart.exe and type “help”. You can see all commands supported by Diskpart. We use diskpart for performing following actions:-

a) For creating/attaching/detaching virtual disks (use “Create”, “Attach”, “Detach” commands)b) For creating, getting list of volumes, deleting volumes (use “Create”, “List”, “Delete”

commands) c) For removing/assigning drive letters a volume (use “Assign”, “Remove” commands) d) For setting attributes to a volume e.g., hidden attribute for making a volume hidden. (use

“Attributes” command)

Simbad ToolThis tool is needed to insert bad sectors in files and test backup/recovery. After installing blbtest, you can run “InstallSimBad.cmd /I <TestBinRoot>” for installing Simbad on your machine.

a) Enable Simbad.exe on hard disk- Simbad /e /h <diskNumber> e.g. Simbad /e /h 0

b) Create bad clusters on file- Simbad <filename> /s <sectorNumber> e.g. Simbad D:\FOO\xyz.txt /s 0

c) To verify if bad clusters are present- Open the file and check if it errors

e.g. On elevated command prompt, run Type D:\FOO\xyz.txt Data Error (Cyclic Redundancy Check)

d) Clear bad sector on hard disk- Simbad /c /h <diskNumber> e.g. Simbad /c /h 0

Group Policy Editor (GPEDIT.MSC)a) Open GPEdit.mscb) Go to UserConfiguration->Administrative Templates ->Windows Components ->Backup-

>Clientc) There are 7 backup/restore policies listed under above path. Edit these policies as per your

test requirements.

DVD Test HookDvdTestHook.exe is part of blbtest(Windows Server Backup Test) installation. Running this command will set a registry key for simulating DVD spanning scenario with only one DVD. This hook sets n MBs as DVD full capacity.

Sample Run:- DVDTestHook.exe add 100.

Page 7: Win 7 COOKBOOK

Above command will set DVD full capacity as 100 MB. That means, after writing 100 MB of data on a DVD, backup reports DVD as full and asks for new DVD insertion. In automated tests, we use same DVD instead of inserting new DVD after copying DVD contents to other location.

In manual tests, this hook is used for DVD spanning scenarios.

He ToolHe is a tool for corrupting VHD files. Available at [WTT\OSBinRoot]\idw

SFPCopysfpcopy is an idw tool for overwriting system files. Available at [WTT\OSBinRoot]\idw

ICALCS ToolICALCS.exe is inbox tool for looking at ACL of any folder/file and setting ACLs also. This is used for verifying ACLs on any file

MkLinkMkLink.exe command can be used for creating reparse points.

MKLINK [[/D] | [/H] | [/J]] Link Target

/D Creates a directory symbolic link. Default is a file symbolic link.

/H Creates a hard link instead of a symbolic link.

/J Creates a Directory Junction.

Link specifies the new symbolic link name.

Target specifies the path (relative or absolute) that the new link refers to

Sample steps for creation of a hardlink which is a kind of reparse point. Below we have created a new file 1.txt of length 1024. And, then we created a hardlink named 2.txt for it and verified that hardlink successfully got created.

1. Fsutil file create new 1.txt 10242. Mklink /h 2.txt 1.txt3. Verified that hardlink got created by listing them using “fsutil hardlink list 1.txt” command

AttribAttrib.exe command can be used to display and change file attributes

Usage:-

Page 8: Win 7 COOKBOOK

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [+I | -I]

[drive:][path][filename] [/S [/D] [/L]]

+ Sets an attribute.

- Clears an attribute.

R Read-only file attribute.

A Archive file attribute.

S System file attribute.

H Hidden file attribute.

I Not content indexed file attribute.

[drive:][path][filename]

Specifies a file or files for attrib to process.

/S Processes matching files in the current folder

and all subfolders.

/D Processes folders as well.

/L Work on the attributes of the Symbolic Link versus

the target of the Symbolic Link

Other Inbox ToolsFor sparse: fsutil.exe sparse. You can check other commands of fsutil.exe by running “fsutil.exe /?”

For reparse and hardlink : mklink.exe

For Compression: Compact.exe

For Encryption: cipher.exe

Other Tools Usage Info required in execution of Manual tests

How to make a volume critical in Client1) Install blbtest. Make sure blbtestutil.exe is present in \blbtest directory.2) Create a new volume that you want to treat as a Critical volume. E.g. (H:)3) Create a temp dir in H:. H:\Test.4) Create a temp file in H:\Test\Test.exe5) Open Cmd prompt.6) cd \blbtest

Page 9: Win 7 COOKBOOK

7) Stop wbengine server using net stop wbengine.8) blbtestutil.exe –operation installsvc –filepath h:\test\test.exe –svcname <testsvcname>9) This installs a service with the specified binary path and hence the volume becomes critical.10) Verify using: wbadmin start backup –allcritical –backuptarget:<X>:. This command will show the

list of critical volumes in your system.11) You can also use Adhoc CPCUI to check the list of critical volumes.

How to make a volume critical in Server1) Install blbtest. Make sure blbtestwriter.exe is present in \blbtest directory.2) Create a new volume that you want to treat as a Critical volume. E.g. (H:)3) Create a temp dir in H:. H:\Test.4) Create a temp file in H:\Test\Test.txt5) Open Cmd prompt.6) cd \blbtest7) Create a new file: \blbtest\filespec.txt. Write H:\Test\|*|y| to filespec.txt8) Stop wbengine server using net stop wbengine.9) Start blbtestwriter.exe and pass the filename as argument. E.g. blbtestwriter.exe filespec.txt.10) Blbtestwriter.exe will now point a System writer file in the new drive and it will become critical. 11) Verify using: wbadmin start backup –allcritical –backuptarget:<X>:. This command will show the

list of critical volumes in your system.12) You can also use Adhoc CPCUI to check the list of critical volumes.

Using the “Vshadow.exe” and “Vssadmin” utility,Shadow copy of any specific volume can be deleted in the middle of the backup, at the time of shadow copy creation.

- On elevated command prompt, run Vssadmin list shadows. It will list out the shadow copy of the volumes.

- To delete a shadow copy of specific volume, Go to cd %systemdrive%\blbtest.- Run Vshadow -ds={<Snapshot Id of specific volume listed on Vssadmin list shadows output>} - To delete all shadows copy of all the volumes or available in the system-- Run Vshadow –da

To know more about Vshadow utility, see the help.

The Vssagent.exe is a good tool for collecting VSS diagnostics information. It collects information related to VSS, SPP and writers and puts it into an .xml file that can be viewed using vsdiagview.exe. Both of these tools are available under the [WTT\OSBinRoot]\Vsstools.

VSS logs some Enter/Leave traces for different events sent to the writers in the registry under HKLM\System\CurrentControlSet\Services\VSS.

Page 10: Win 7 COOKBOOK

These logs can be useful in the scenarios when a writer is hung and no other tool would inform about the list of writers and their state.

The following commands can be used for collecting the diagnostics using vssagent:

VSSAGENT -setparam GatherDataFlags 253

VSSAGENT -gather vssdiag.xml

VSSAGENT -setparam GatherDataFlags 0

The above command would create vssdiag.xml that can be viewed using vsdiagview.exe.

How to collect VSS tracesPlease follow the following instructions to get vss traces if in case there are any vss related issues:

1. Start the tracing in an elevated command prompt:[WTT\OSBinRoot]\Vsstools\generate_vss_reports.cmd

2. Repro in another shell/UI3. Stop the tracing by pressing enter in the original command shell

Pack the vssdiag root of the volume and send to vssclub

How to simulate disk failure1. Pre-requisite : Machine should have WTT installed.2. For simulating failure on disk: copy [WTT\TestBinRoot]\NTTEST\BASETEST\Diagnosibility\DFD

to locally.3. Install the driver using rundll32 setupapi.dll,InstallHinfSection,131,DiskFailureFilter.inf or right

click on DiskFailureFilter.inf file and click on install. Then reboot the system.4. After the system has rebooted, go to the path where you have copied DFD dir and run DFDTESTS

0 6 (Injecting failure into disk 0).5. To turn off injection run DFDTESTS 0 7.6. Run backup on the disk in which injected the simulation.7. Backup will fail and action center will show yellow color message “Backup disk is about to fail”.

Test hook for disable and enable system writer 1. Install test2. Go to <systemvol>\blbtest 3. To disable system writer run DisableSystemWriterForSSR_SSB.reg4. To enable system writer, run EnableSystemWriterForSSR_SSB.reg

Page 11: Win 7 COOKBOOK

To separate system volume and boot volume1. Install test2. Go to <systemvol>\blbtest 3. Run PrepareMachineForBitlocker.exe and reboot the machine

How to make the volume dirty1. Run fsutil dirty set <driveletterofvolume>2. To make the volume back to normal state, run chkdisk.

Prerequisite knowledgeAssume common knowledge is mastered by WinSE on-site vendors. For example:

. OS deployment

. DC Setup

. Hyper-v setup

. BitLocker

. Network configuration on test machine (IPv4/v6. Dynamic/static IP addresses, Gateway. DNS WINS, etc)

.Basic knowledge about Windows Backup and Storage Technology

Specific Component knowledgeAll the specific component knowledge has been captured in the different documents referred in Resources

Windows Backup Diagnostic InformationWindows Backup log files(ETL format) are present in “ %windir%\Logs\WindowsBackup” directory.

System Restore log files are put in “%windir%\Logs\SystemRestore” directory.

You can use Log Parsing Tool for parsing the logs.

Page 12: Win 7 COOKBOOK

Appendix

Diagnosing Backup Failures

WBDiag Tracing ToolWbdiag.exe is part of WSB test install.

a) Run “Wbdiag.exe –mode on”b) Run your scenario (any backup/recovery)c) Run “Wbdiag.exe –mode off -p \\MachineName\Symbols\TraceFormat”

Above command will generate product traces in ETL format which can be trace formatted using tracefmt.exe explained below.

Log Parsing ToolWe use “tracefmt.exe” tool for trace formatting the backup traces. It’s present in test installation. Usage of it is:-

Tracefmt.exe <ETL File> -o <Output Text File> -p <Symbols Path>

Example Usage:-tracefmt.exe C:\Windows\Logs\WindowsBackup\WindowsBackup.1.etl -o C:\WindowsBackupLogs.txt -p \\winbuilds\release\india\win7_rtm\7600.16385.0907131255\amd64fre\symbols.pri\TraceFormat

File System Concepts

ACL’sAn Access Control List (ACL) is a list of permissions attached to an object. An ACL specifies which users--or system processes--are granted access to objects, as well as what operations are allowed to be performed on given objects. In a typical ACL, each entry in the list specifies a subject and an operation (e.g. the entry (Alice, delete) on the ACL for file WXY gives Alice permission to delete file WXY).

You can use ICALCS.exe command to view/change ACLs. This tool is inbuilt into the OS.

File Attributes

File attributes can be used to write-protect, hide, and unhide files, or as behind-the-scenes file maintenance:

Read-only: Can be read, but not changed or deleted Hidden: By default do not appear in a directory listing Archive: Use to selectively back up or copy files; most helpful in DOS

Page 13: Win 7 COOKBOOK

System: Flagged for use by the operating system; not usually displayed in a directory listing

File Attributes can be set/verified by using Attrib.exe tool mentioned in tools section

Reparse PointReparse points are used to implement NTFS file system links. They can be created using MkLink.exe command.

Reparse Points can be created using mklink.exe mentioned in tools section

VHDA Virtual Hard Disk (VHD) is a file formatted to be structurally identical to a physical Hard Disk Drive

VHD can be created/deleted/mounted by using DiskMgmt.msc and Diskpart.exe