Spirent Avalanche 5.46 February 29, 2024

CIFSNG Data Validation

NOTE: CIFSNG data validation is supported only when running against a real CIFS server, since the emulated server does not perform any real I/O when a client issues a write command.

For validating data when writing to a file, the following commands/options are available:

Divide the write request into smaller chunks, and validate each without closing the file.

Divide the write request into smaller chunks, and validate each after closing/reopening the file.

Write the entire file, and then validate after closing/reopening the file.

The following sections describe the Actions list syntax and examples for the above commands/options.

WRITE_VALIDATE with FORCE_CLOSE_PER_CHUNK=FALSE

In this case, the request is divided into multiple smaller WRITE requests (chunks). After writing a chunk to the server, the client reads and validates it without closing the file. The client continues to write the next chunk, read, validate, and so on.

You use the WRITE_VALIDATE command in CIFSNG actions. This command has all the functionality of the regular WRITE command (On-the-Fly, data randomization, forms database, etc.), as well as similar syntax. Specify FORCE_CLOSE_PER_CHUNK=FALSE to validate without closing the file.

Examples

FSTREE=cifs

CIFSNG://192.168.1.1 USER=cifs_server PASSWD=welcome AUTH_TYPE=NTLMv2 AUTHDOMAIN=your_domain CONNECTION_TREE=Shared DIALECT=2.002

ASSIGN VARIABLE <theFileName Form_1.$1>

ASSIGN VARIABLE <theSrcFileName Form_1.$2>

ASSIGN VARIABLE <forceClose Form_1.$3>

CIFS_SUB_CMD OPEN_NEW FILENAME_VAR=<APPLY theFileName>

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME_VAR=<APPLY theFileName>   INPUT_SOURCE_VAR=<APPLY theSrcFileName>  FORCE_CLOSE_PER_CHUNK_VAR=<APPLY forceClose>

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME_VAR=<APPLY theFileName>  BYTE_SIZE=1500        INPUT_SOURCE_VAR=<APPLY theSrcFileName>  FORCE_CLOSE_PER_CHUNK_VAR=<APPLY forceClose>

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME_VAR=<APPLY theFileName>  OFFSET=0              BYTE_SIZE=1500  INPUT_SOURCE_VAR=<APPLY theSrcFileName>  INPUT_OFFSET=0   FORCE_CLOSE_PER_CHUNK_VAR=<APPLY forceClose>

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME_VAR=<APPLY theFileName>  OFFSET=0  RANDOMIZE_OFFSET  BYTE_SIZE=1500  INPUT_SOURCE_VAR=<APPLY theSrcFileName>   INPUT_OFFSET=0  FORCE_CLOSE_PER_CHUNK_VAR=<APPLY forceClose>

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME_VAR=<APPLY theFileName>  OFFSET=0              RANDOMIZE_OFFSET  BYTE_SIZE=1500  INPUT_SOURCE_VAR=<APPLY theSrcFileName>  FORCE_CLOSE_PER_CHUNK_VAR=<APPLY forceClose>

CIFS_SUB_CMD CLOSE FILENAME_VAR=<APPLY theFileName>

WRITE_VALIDATE with FORCE_CLOSE_PER_CHUNK=TRUE

In this case, the request is divided into multiple smaller WRITE requests (chunks). After writing a chunk to the server, the client closes/reopens the file, and then reads and validates the chunk. The client continues to write the next chunk, close/reopen the file, read, validate, and so on.

You use the WRITE_VALIDATE command in CIFSNG actions. This command has all the functionality of the regular WRITE command (On-the-Fly, data randomization, forms database, etc.), as well as similar syntax. Specify FORCE_CLOSE_PER_CHUNK=TRUE to validate after closing/reopening the file.

When you specify FORCE_CLOSE_PER_CHUNK=TRUE, you can also use the WAIT_TIME debug option. This option allows you to insert a number of seconds to wait after closing the file and before reopening it. You could use this time to manually change the last written chunk of the file on the server, so that the validation will fail, as an example.

IMPORTANT: The WAIT_TIME option is very inefficient. You should not use it, unless you want to intentionally cause the validation to fail for debugging purposes.

NOTES:

  • The WAIT_TIME option is not applicable when you set FORCE_CLOSE_PER_CHUNK=FALSE, and will result in an error.
  • Forms databases are not supported for the WAIT_TIME option.
  • The examples in the previous section for FORCE_CLOSE_PER_CHUNK=FALSE also apply for FORCE_CLOSE_PER_CHUNK=TRUE. The following examples illustrate use of the WAIT_TIME option with FORCE_CLOSE_PER_CHUNK=TRUE.
Examples

FSTREE=cifs

CIFSNG://192.168.1.1 USER=cifs_server PASSWD=welcome AUTH_TYPE=NTLMv2 AUTHDOMAIN=your_domain CONNECTION_TREE=Shared DIALECT=2.002

CIFS_SUB_CMD OPEN_NEW FILENAME=directory_name/test.txt

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME=directory_name/test.txt  BYTE_SIZE=1500 INPUT_SOURCE= ON_THE_FLY FORCE_CLOSE_PER_CHUNK=TRUE WAIT_TIME=10

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME=directory_name/test.txt  OFFSET=XXX BYTE_SIZE=YYY INPUT_SOURCE= ON_THE_FLY INPUT_OFFSET=0 FORCE_CLOSE_PER_CHUNK=TRUE WAIT_TIME=10

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME=directory_name/test.txt  OFFSET=XXX  RANDOMIZE_OFFSET BYTE_SIZE=YYY INPUT_SOURCE=ON_THE_FLY INPUT_OFFSET=ZZZ FORCE_CLOSE_PER_CHUNK=TRUE WAIT_TIME=10

CIFS_SUB_CMD WRITE_VALIDATE  FILENAME=directory_name/test.txt  OFFSET=XXX  RANDOMIZE_OFFSET BYTE_SIZE=YYY INPUT_SOURCE=ON_THE_FLY FORCE_CLOSE_PER_CHUNK=TRUE WAIT_TIME=10

CIFS_SUB_CMD CLOSE  FILENAME=directory_name/test.txt

WRITE_ENTIRE_FILE_THEN_VALIDATE

In this case, the entire file is written before validation. After the client writes all the chunks of data to the file, it closes/reopens the file, and then reads and validates the entire file.

You use the WRITE_ENTIRE_FILE_THEN_VALIDATE command in CIFSNG actions. This command does not have all the functionality of the regular WRITE command (unlike the WRITE_VALIDATE command).  

With the WRITE_ENTIRE_FILE_THEN_VALIDATE command, you can also use the WAIT_TIME debug option.

NOTES:

  • You must always use a real file as INPUT_SOURCE with the WRITE_ENTIRE_FILE_THEN_VALIDATE command.
  • The following two examples illustrate the only acceptable formats for the WRITE_ENTIRE_FILE_THEN_VALIDATE command.
Examples

FSTREE=cifs

CIFSNG://192.168.1.1 USER=cifs_server PASSWD=welcome AUTH_TYPE=NTLMv2 AUTHDOMAIN=your_domain CONNECTION_TREE=Shared DIALECT=2.002

CIFS_SUB_CMD OPEN_NEW FILENAME=directory_name/test.txt

CIFS_SUB_CMD WRITE_ENTIRE_FILE_THEN_VALIDATE  FILENAME=directory_name/test.txt  INPUT_SOURCE= directory_name/src.txt  WAIT_TIME=10

CIFS_SUB_CMD CLOSE  FILENAME=directory_name/test.txt


Testing CIFSNG/SMB

Client Profiles SMB Fields

© 2024 Spirent Communications, Inc. All Rights Reserved.