Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 4108e77e0eb091fdd9b9c4174374a6ac0cc0abd0 authored by Dmitry Belyavskiy on 27 May 2020, 09:56:07 UTC, committed by Dmitry Belyavskiy on 27 May 2020, 09:56:07 UTC
API changes
1 parent a90ad6c
  • Files
  • Changes
  • 2879a7b
  • /
  • tcl_tests
  • /
  • calchash.tcl
Raw File
Cook and download a directory from the Software Heritage Vault

You have requested the cooking of the directory with identifier None into a standard tar.gz archive.

Are you sure you want to continue ?

Download a directory from the Software Heritage Vault

You have requested the download of the directory with identifier None as a standard tar.gz archive.

Are you sure you want to continue ?

Cook and download a revision from the Software Heritage Vault

You have requested the cooking of the history heading to revision with identifier swh:1:rev:4108e77e0eb091fdd9b9c4174374a6ac0cc0abd0 into a bare git archive.

Are you sure you want to continue ?

Download a revision from the Software Heritage Vault

You have requested the download of the history heading to revision with identifier swh:1:rev:4108e77e0eb091fdd9b9c4174374a6ac0cc0abd0 as a bare git archive.

Are you sure you want to continue ?

Invalid Email !

The provided email is not well-formed.

Download link has expired

The requested archive is no longer available for download from the Software Heritage Vault.

Do you want to cook it again ?

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • content
revision badge
swh:1:rev:4108e77e0eb091fdd9b9c4174374a6ac0cc0abd0
content badge Iframe embedding
swh:1:cnt:b943bef98c346f9a0742a7e3243b2808e0066cde
calchash.tcl
#!/usr/bin/tclsh
lappend auto_path [file dirname [info script]]
package require test

if {$::tcl_platform(platform) eq "windows"} {
	set prefix {//laputa/dist/magpro/FSB_CryptoPack_21.1/binaries}
} else {
	set prefix {/net/laputa/pub/magpro/FSB_CryptoPack_21.1/binaries}
}
set PREFIX_ENV_NAME CALCHASH_PREFIX
if {$argc != 1} {
        puts stderr "Usage $argv0 path"
	puts stderr "This script tests programms prefix/path/calchach and prefix/path/gostsum."
	puts stderr "Defauld prefix is $prefix"
	puts stderr "Prefix can be changes by envirament veriable $PREFIX_ENV_NAME"
        exit 1
}

if {[info exist env($PREFIX_ENV_NAME)]} {
	set prefix $env($PREFIX_ENV_NAME)
}
set path [lindex $argv 0]

set testdir [exec hostname]-hashes
puts $testdir
catch {file delete -force $testdir}
file mkdir $testdir
cd $testdir

start_tests "Тесты для программ calchash и gostsum"

test -createsfiles dgst.dat "calchash" {
	makeFile dgst.dat [string repeat "Test data to digest.\n" 100] binary
	string match *DB9232D96CAE7AABA817350EF6CF4C25604D8FD36965F78CEB3CE59FD31CCB2A [exec $prefix/$path/calchash dgst.dat]
} 0 1 

test -platform unix "gostsum (paramset cryptopro-A)" {
	exec $prefix/$path/gostsum dgst.dat
} 0 "5c8621c036f8636fa3ea711a78e5051f607c87b4b715482af74b2b1cce62e442 dgst.dat" 


test -platform unix "gostsum -t (paramset test)" {
	exec $prefix/$path/gostsum -t dgst.dat
} 0 "db9232d96cae7aaba817350ef6cf4c25604d8fd36965f78ceb3ce59fd31ccb2a dgst.dat" 


end_tests
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top