Import to git.
This commit is contained in:
parent
8c4dad4c86
commit
bae38aad77
|
@ -0,0 +1,283 @@
|
|||
;;;
|
||||
;;; Copyright (c) 2004 - 2012 Michael Tuexen
|
||||
;;;
|
||||
;;; All rights reserved.
|
||||
;;;
|
||||
;;; Redistribution and use in source and binary forms, with or
|
||||
;;; without modification, are permitted provided that the
|
||||
;;; following conditions are met:
|
||||
;;; 1. Redistributions of source code must retain the above
|
||||
;;; copyright notice, this list of conditions and the
|
||||
;;; following disclaimer.
|
||||
;;; 2. Redistributions in binary form must reproduce the
|
||||
;;; above copyright notice, this list of conditions and
|
||||
;;; the following disclaimer in the documentation and/or
|
||||
;;; other materials provided with the distribution.
|
||||
;;; 3. Neither the name of the project nor the names of
|
||||
;;; its contributors may be used to endorse or promote
|
||||
;;; products derived from this software without specific
|
||||
;;; prior written permission.
|
||||
;;;
|
||||
;;; THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS
|
||||
;;; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
;;; BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
;;; DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS
|
||||
;;; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
;;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
;;; IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
;;; OF SUCH DAMAGE.
|
||||
|
||||
;;; $Id: common.scm,v 1.8 2012/08/25 14:37:00 tuexen Exp $
|
||||
|
||||
;;; Load the SCTP API needed.
|
||||
(if (not (defined? 'sctp-send-with-crc32c))
|
||||
(use-modules (net sctp)))
|
||||
|
||||
(if (string=? (major-version) "1")
|
||||
(use-modules (ice-9 syncase)))
|
||||
|
||||
;;; Just have a convenient way of simple looping.
|
||||
(define-syntax dotimes
|
||||
(syntax-rules ()
|
||||
((_ (var n res) . body)
|
||||
(do ((limit n)
|
||||
(var 0 (+ var 1)))
|
||||
((>= var limit) res)
|
||||
. body))
|
||||
((_ (var n) . body)
|
||||
(do ((limit n)
|
||||
(var 0 (+ var 1)))
|
||||
((>= var limit))
|
||||
. body))))
|
||||
|
||||
;;; The following functions implement modulo arithmetic.
|
||||
(define 2^8 (expt 2 8))
|
||||
(define 2^16 (expt 2 16))
|
||||
(define 2^24 (expt 2 24))
|
||||
(define 2^32 (expt 2 32))
|
||||
|
||||
(define 2^8-1 (1- 2^8))
|
||||
(define 2^16-1 (1- 2^16))
|
||||
(define 2^24-1 (1- 2^24))
|
||||
(define 2^32-1 (1- 2^32))
|
||||
|
||||
(define (+mod2^8 x y)
|
||||
(modulo (+ x y) 2^8))
|
||||
(define (-mod2^8 x y)
|
||||
(modulo (- x y) 2^8))
|
||||
(define (*mod2^8 x y)
|
||||
(modulo (* x y) 2^8))
|
||||
|
||||
(define (+mod2^16 x y)
|
||||
(modulo (+ x y) 2^16))
|
||||
(define (-mod2^16 x y)
|
||||
(modulo (- x y) 2^16))
|
||||
(define (*mod2^16 x y)
|
||||
(modulo (* x y) 2^16))
|
||||
|
||||
(define (+mod2^24 x y)
|
||||
(modulo (+ x y) 2^24))
|
||||
(define (-mod2^24 x y)
|
||||
(modulo (- x y) 2^24))
|
||||
(define (*mod2^24 x y)
|
||||
(modulo (* x y) 2^24))
|
||||
|
||||
(define (+mod2^32 x y)
|
||||
(modulo (+ x y) 2^32))
|
||||
(define (-mod2^32 x y)
|
||||
(modulo (- x y) 2^32))
|
||||
(define (*mod2^32 x y)
|
||||
(modulo (* x y) 2^32))
|
||||
|
||||
;;; The following functions convert unsigned integers into
|
||||
;;; a list of bytes in network byte order.
|
||||
|
||||
(define (uint8->bytes n)
|
||||
(if (and (exact? n) (integer? n) (<= 0 n 2^8-1))
|
||||
(list n)
|
||||
(error "Argument not a uint8" n)))
|
||||
|
||||
;;;(uint8->bytes 1)
|
||||
;;;(uint8->bytes -1)
|
||||
;;;(uint8->bytes 2^8)
|
||||
;;;(uint8->bytes 2.0)
|
||||
|
||||
(define (uint16->bytes n)
|
||||
(if (and (exact? n) (integer? n) (<= 0 n 2^16-1))
|
||||
(list (quotient n 2^8)
|
||||
(remainder n 2^8))
|
||||
(error "Argument not a uint16" n)))
|
||||
|
||||
;;;(uint16->bytes 1)
|
||||
;;;(uint16->bytes 2^8)
|
||||
;;;(uint16->bytes 2^16)
|
||||
;;;(uint16->bytes 2^16-1)
|
||||
|
||||
(define (uint24->bytes n)
|
||||
(if (and (exact? n) (integer? n) (<= 0 n 2^24-1))
|
||||
(list (quotient n 2^16)
|
||||
(quotient (remainder n 2^16) 2^8)
|
||||
(remainder n 2^8))
|
||||
(error "Argument not a uint24" n)))
|
||||
|
||||
;;;(uint24->bytes 1)
|
||||
;;;(uint24->bytes 2^8)
|
||||
;;;(uint24->bytes 2^16)
|
||||
;;;(uint24->bytes 2^24-1)
|
||||
|
||||
(define (uint32->bytes n)
|
||||
(if (and (exact? n) (integer? n) (<= 0 n 2^32-1))
|
||||
(list (quotient n 2^24)
|
||||
(quotient (remainder n 2^24) 2^16)
|
||||
(quotient (remainder n 2^16) 2^8)
|
||||
(remainder n 2^8))
|
||||
(error "Argument not a uint32" n)))
|
||||
|
||||
;;;(uint32->bytes 1)
|
||||
;;;(uint32->bytes 2^8)
|
||||
;;;(uint32->bytes 2^16)
|
||||
;;;(uint32->bytes 2^24)
|
||||
;;;(uint32->bytes 2^32-1)
|
||||
|
||||
(define uint8->big-endian-bytes uint8->bytes)
|
||||
(define uint16->big-endian-bytes uint16->bytes)
|
||||
(define uint24->big-endian-bytes uint24->bytes)
|
||||
(define uint32->big-endian-bytes uint32->bytes)
|
||||
|
||||
(define (uint8->little-endian-bytes n)
|
||||
(reverse (uint8->bytes n)))
|
||||
|
||||
(define (uint16->little-endian-bytes n)
|
||||
(reverse (uint16->bytes n)))
|
||||
|
||||
(define (uint24->little-endian-bytes n)
|
||||
(reverse (uint24->bytes n)))
|
||||
|
||||
(define (uint32->little-endian-bytes n)
|
||||
(reverse (uint32->bytes n)))
|
||||
|
||||
;;;(uint32->little-endian-bytes 1024)
|
||||
|
||||
|
||||
;;; The following functions converts the first bytes of the argument
|
||||
;;; to an unsigned integer in host byte order.
|
||||
|
||||
(define (bytes->uint8 l)
|
||||
(car l))
|
||||
|
||||
;;;(bytes->uint8 (uint8->bytes 56))
|
||||
|
||||
(define (bytes->uint16 l)
|
||||
(+ (* 2^8 (car l))
|
||||
(cadr l)))
|
||||
|
||||
;;;(bytes->uint16 (uint16->bytes 12345))
|
||||
|
||||
(define (bytes->uint24 l)
|
||||
(+ (* 2^16 (car l))
|
||||
(* 2^8 (cadr l))
|
||||
(caddr l)))
|
||||
|
||||
;;;(bytes->uint24 (uint24->bytes 12345567))
|
||||
|
||||
(define (bytes->uint32 l)
|
||||
(+ (* 2^24 (car l))
|
||||
(* 2^16 (cadr l))
|
||||
(* 2^8 (caddr l))
|
||||
(cadddr l)))
|
||||
|
||||
;;;(bytes->uint32 (uint32->bytes 2^32-1))
|
||||
|
||||
(define (list-head l n)
|
||||
(list-head-1 l n (list)))
|
||||
|
||||
(define (list-head-1 l n r)
|
||||
(if (<= n 0)
|
||||
(reverse r)
|
||||
(list-head-1 (cdr l) (- n 1) (cons (car l) r))))
|
||||
;;; (list-head (list 1 2 3) 4)
|
||||
|
||||
(define big-endian-bytes->uint8 bytes->uint8)
|
||||
(define big-endian-bytes->uint16 bytes->uint16)
|
||||
(define big-endian-bytes->uint24 bytes->uint24)
|
||||
(define big-endian-bytes->uint32 bytes->uint32)
|
||||
|
||||
(define (little-endian-bytes->uint8 l)
|
||||
(bytes->uint8 (reverse (list-head l 1))))
|
||||
|
||||
(define (little-endian-bytes->uint16 l)
|
||||
(bytes->uint16 (reverse (list-head l 2))))
|
||||
|
||||
(define (little-endian-bytes->uint24 l)
|
||||
(bytes->uint24 (reverse (list-head l 3))))
|
||||
|
||||
(define (little-endian-bytes->uint32 l)
|
||||
(bytes->uint32 (reverse (list-head l 4))))
|
||||
;;;(little-endian-bytes->uint32 (uint32->little-endian-bytes 123456))
|
||||
|
||||
;;; This function generates a list of bytes representing a string.
|
||||
|
||||
(define (string->bytes s)
|
||||
(map char->integer (string->list s)))
|
||||
|
||||
;;;(string->bytes "Hello")
|
||||
|
||||
;;; Convert a list of bytes to a string which can be used by the send call
|
||||
|
||||
(define (bytes->string l)
|
||||
(list->string (map integer->char l)))
|
||||
|
||||
;;; (bytes->string '(65 65 65 0 65))
|
||||
|
||||
;;; This function generates a list of random bytes of a given length
|
||||
|
||||
(define (random-bytes n)
|
||||
(random-bytes-1 n (list)))
|
||||
|
||||
;;; This is the tail-recursive version
|
||||
|
||||
(define (random-bytes-1 n l)
|
||||
(if (<= n 0)
|
||||
l
|
||||
(random-bytes-1 (- n 1) (cons (random 2^8) l))))
|
||||
|
||||
;;; (random-bytes 10000)
|
||||
|
||||
(define (zero-bytes n)
|
||||
(zero-bytes-1 n (list)))
|
||||
|
||||
(define (zero-bytes-1 n l)
|
||||
(if (<= n 0)
|
||||
l
|
||||
(zero-bytes-1 (- n 1) (cons 0 l))))
|
||||
|
||||
;;;(length (zero-bytes 3400))
|
||||
;;;(zero-bytes 0)
|
||||
|
||||
(define (remove pred lst)
|
||||
(if (null? lst)
|
||||
(list)
|
||||
(if (pred (car lst))
|
||||
(remove pred (cdr lst))
|
||||
(cons (car lst) (remove pred (cdr lst))))))
|
||||
;;; (remove positive? (list 1 -32 3 -9))
|
||||
;;; (remove positive? (list -9))
|
||||
;;; (remove positive? (list 1 2 3))
|
||||
|
||||
(define (filter pred lst)
|
||||
(if (null? lst)
|
||||
(list)
|
||||
(if (pred (car lst))
|
||||
(cons (car lst) (filter pred (cdr lst)))
|
||||
(filter pred (cdr lst)))))
|
||||
;;; (filter positive? (list 1 -32 3 -9))
|
||||
;;; (filter positive? (list -9))
|
||||
;;; (filter positive? (list 1 2 3))
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
;;;
|
||||
;;; Copyright (c) 2011 Michael Tuexen
|
||||
;;; All rights reserved.
|
||||
;;;
|
||||
;;; Redistribution and use in source and binary forms, with or without
|
||||
;;; modification, are permitted provided that the following conditions
|
||||
;;; are met:
|
||||
;;; 1. Redistributions of source code must retain the above copyright
|
||||
;;; notice, this list of conditions and the following disclaimer.
|
||||
;;; 2. Redistributions in binary form must reproduce the above copyright
|
||||
;;; notice, this list of conditions and the following disclaimer in the
|
||||
;;; documentation and/or other materials provided with the distribution.
|
||||
;;;
|
||||
;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
;;; SUCH DAMAGE.
|
||||
;;;
|
||||
;;; $Id: dotguile,v 1.1 2012/08/26 21:06:27 tuexen Exp $
|
||||
|
||||
;;; Change the following line to reflect where the files are located.
|
||||
(define dir "/Users/tuexen/Documents/m3ua-testtool/")
|
||||
(define files (list "common.scm"
|
||||
"m3ua.scm"
|
||||
"m3ua-asp-tests.scm"
|
||||
"m3ua-sgp-tests.scm"
|
||||
"m3ua-param-testtool.scm"))
|
||||
(map (lambda (file) (load-from-path (string-append dir file))) files)
|
|
@ -0,0 +1,679 @@
|
|||
;;;
|
||||
;;; Copyright (C) 2005 M. Tuexen tuexen@fh-muenster.de
|
||||
;;;
|
||||
;;; All rights reserved.
|
||||
;;;
|
||||
;;; Redistribution and use in source and binary forms, with or
|
||||
;;; without modification, are permitted provided that the
|
||||
;;; following conditions are met:
|
||||
;;; 1. Redistributions of source code must retain the above
|
||||
;;; copyright notice, this list of conditions and the
|
||||
;;; following disclaimer.
|
||||
;;; 2. Redistributions in binary form must reproduce the
|
||||
;;; above copyright notice, this list of conditions and
|
||||
;;; the following disclaimer in the documentation and/or
|
||||
;;; other materials provided with the distribution.
|
||||
;;; 3. Neither the name of the project nor the names of
|
||||
;;; its contributors may be used to endorse or promote
|
||||
;;; products derived from this software without specific
|
||||
;;; prior written permission.
|
||||
;;;
|
||||
;;; THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS
|
||||
;;; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
;;; BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
;;; DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS
|
||||
;;; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
;;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
;;; IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
;;; OF SUCH DAMAGE.
|
||||
|
||||
;;; $Id: m3ua-asp-tests.scm,v 1.12 2012/08/28 19:56:13 tuexen Exp $
|
||||
|
||||
;;; History
|
||||
;;; 13.09.2005: Implement ASP tests.
|
||||
;;; 09.10.2005: Provide example calls for the ASP.
|
||||
;;; 07.01.2006: Implement missing ASP tests.
|
||||
;;; 27.08.2006: Added m3ua-asp-aspsm-v-005-alternate
|
||||
;;; 27.08.2006: Added m3ua-asp-aspsm-i-002-alternate
|
||||
;;;
|
||||
;;; Definition of the tests for the ASP
|
||||
;;;
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-v-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-asp-up-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-version msg) 1)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed))))
|
||||
;;; (m3ua-asp-aspsm-v-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the version in the common header of the
|
||||
;;; received packet is 1.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive))
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-v-005 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-asp-down-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-version msg) 1)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed))))
|
||||
;;; (m3ua-asp-aspsm-v-005 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the version in the common header of the
|
||||
;;; received packet is 1.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-down))
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-v-005-alternate tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(let ((asp-inactive (m3ua-wait-for-message fd m3ua-asp-inactive-message?)))
|
||||
(if (= (m3ua-get-version asp-inactive) 1)
|
||||
(begin
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-inactive-ack-message (m3ua-get-parameters asp-inactive)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-down-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-down-ack-message))
|
||||
(close fd)
|
||||
m3ua-test-result-passed)
|
||||
(begin
|
||||
(close fd)
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-aspsm-v-005-alternate tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ASP_INACTIVE with version 1.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-inactive))
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-i-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-common-header (+ m3ua-version 1)
|
||||
m3ua-reserved
|
||||
m3ua-aspsm-message-class
|
||||
m3ua-aspup-ack-message-type
|
||||
m3ua-common-header-length))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-invalid-version-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed))))
|
||||
;;; (m3ua-asp-aspsm-i-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT returns an ERROR(invalid version)
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive))
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-i-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(m3ua-wait-for-message fd m3ua-asp-down-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-common-header (+ m3ua-version 1)
|
||||
m3ua-reserved
|
||||
m3ua-aspsm-message-class
|
||||
m3ua-aspdn-ack-message-type
|
||||
m3ua-common-header-length))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-invalid-version-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed))))
|
||||
;;; (m3ua-asp-aspsm-i-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT returns an ERROR(invalid version)
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-down))
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-i-002-alternate tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(let ((asp-inactive (m3ua-wait-for-message fd m3ua-asp-inactive-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-inactive-ack-message (m3ua-get-parameters asp-inactive))))
|
||||
(m3ua-wait-for-message fd m3ua-asp-down-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-common-header (+ m3ua-version 1)
|
||||
m3ua-reserved
|
||||
m3ua-aspsm-message-class
|
||||
m3ua-aspdn-ack-message-type
|
||||
m3ua-common-header-length))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-invalid-version-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed))))
|
||||
;;; (m3ua-asp-aspsm-i-002-alternate tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ASP_INACTIVE with version 1.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-inactive m3ua-asp-down))
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-i-003 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
;; FIXME: Should I send the ASPUP-ACK?
|
||||
;; (m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(m3ua-send-message fd 0 (m3ua-make-message m3ua-aspsm-message-class
|
||||
m3ua-reserved-aspsm-message-type
|
||||
(list)))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-unsupported-message-type-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed))))
|
||||
;;; (m3ua-asp-aspsm-i-003 tester-addr tester-port sut-addr sut-port)
|
||||
;;; FIXME: Why states the ETSI document that the ASP is marked as ASP_INACTIVE
|
||||
;;; This test is passed iff the SUT returns an ERROR(unsupported message type)
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive))
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-o-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-down-ack-message))
|
||||
(let ((msg (m3ua-wait-for-message-with-timeout fd m3ua-asp-active-message? 2)))
|
||||
(close fd)
|
||||
(if (null? msg)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed))))
|
||||
;;; (m3ua-asp-aspsm-o-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT does not send an ASP_ACTIVE. FIXME.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive))
|
||||
|
||||
|
||||
(define (m3ua-asp-aspsm-o-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (list)))
|
||||
(let ((msg (m3ua-recv-message-with-timeout fd 2)))
|
||||
(close fd)
|
||||
(if (or (null? msg)
|
||||
(and (m3ua-error-message? msg)
|
||||
(= (m3ua-get-error-code-from-message msg) m3ua-unexpected-message-error-code))
|
||||
(m3ua-asp-up-message? msg))
|
||||
m3ua-test-result-passed
|
||||
(if (m3ua-data-message? msg)
|
||||
m3ua-test-result-failed
|
||||
m3ua-test-result-unknown)))))
|
||||
;;; (m3ua-asp-aspsm-o-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT does send an ERROR(unexpected message).
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-v-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-asptm-v-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ASP_ACTIVE.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-v-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(if (= (m3ua-get-version asp-active) 1)
|
||||
(begin
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(close fd)
|
||||
m3ua-test-result-passed)
|
||||
(begin
|
||||
(close fd)
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-asptm-v-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ASP_ACTIVE with version 1.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-v-005 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(let ((asp-inactive (m3ua-wait-for-message fd m3ua-asp-inactive-message?)))
|
||||
(if (= (m3ua-get-version asp-inactive) 1)
|
||||
(begin
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-inactive-ack-message (m3ua-get-parameters asp-inactive)))
|
||||
(close fd)
|
||||
m3ua-test-result-passed)
|
||||
(begin
|
||||
(close fd)
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-asptm-v-005 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ASP_INACTIVE with version 1.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-inactive))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-v-007 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?))
|
||||
(heartbeat-data (random-bytes 5000)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-beat-message heartbeat-data))
|
||||
(let ((m (m3ua-wait-for-message fd (lambda (m) (or (m3ua-beat-ack-message? m)
|
||||
(m3ua-error-message? m))))))
|
||||
(close fd)
|
||||
(if (m3ua-beat-ack-message? m)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-asptm-v-007 tester-addr tester-port sut-addr sut-port)
|
||||
;;; The last parameter is the length the hearbeat data.
|
||||
;;; This test is passed iff the SUT sends a BEAT_ACK.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-reflect-beat))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-v-008 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?))
|
||||
(heartbeat-data (random-bytes 600)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-beat-message heartbeat-data))
|
||||
(let ((m (m3ua-wait-for-message fd (lambda (m) (or (m3ua-beat-ack-message? m)
|
||||
(m3ua-error-message? m))))))
|
||||
(close fd)
|
||||
(if (and (m3ua-beat-ack-message? m)
|
||||
(equal? (m3ua-make-beat-ack-message heartbeat-data) m))
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-asptm-v-008 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends a BEAT_ACK with unchanged data.
|
||||
;;; This is indicated by returning true.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-reflect-beat))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-i-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-increment-version
|
||||
(m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-invalid-version-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-asptm-i-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ERROR(invalid version).
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-i-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-inactive-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-increment-version
|
||||
(m3ua-make-asp-inactive-ack-message (m3ua-get-parameters asp-active))))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-invalid-version-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-asptm-i-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ERROR(invalid version).
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-inactive))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-i-003 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-message m3ua-asptm-message-class
|
||||
m3ua-reserved-asptm-message-type
|
||||
(list)))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-unsupported-message-type-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-asptm-i-003 tester-addr tester-port sut-addr sut-port)
|
||||
;;; FIXME: Why does the ETSI doucment state that the IUT is in ASP_DOWN.
|
||||
;;; This test is passed iff the SUT sends an ERROR(unsupported message type).
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
|
||||
(define (m3ua-asp-asptm-o-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(m3ua-wait-for-message fd m3ua-asp-active-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((msg (m3ua-recv-message-with-timeout fd 2)))
|
||||
(close fd)
|
||||
(if (or (null? msg)
|
||||
(and (m3ua-error-message? msg)
|
||||
(= (m3ua-get-error-code-from-message msg) m3ua-unexpected-message-error-code))
|
||||
(m3ua-asp-active-message? msg))
|
||||
m3ua-test-result-passed
|
||||
(if (m3ua-data-message? msg)
|
||||
m3ua-test-result-failed
|
||||
m3ua-test-result-unknown)))))
|
||||
;;; (m3ua-asp-asptm-o-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ERROR(unexpected message).
|
||||
;;; FIXME: How to test the data sending?
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
|
||||
(define (m3ua-asp-mtr-v-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(let ((m (m3ua-wait-for-message fd (lambda (m) (or (m3ua-data-message? m)
|
||||
(m3ua-daud-message? m))))))
|
||||
(if (m3ua-daud-message? m)
|
||||
(begin
|
||||
(m3ua-send-message fd 0 (m3ua-make-dava-message (m3ua-get-parameters m)))
|
||||
(m3ua-wait-for-message fd m3ua-data-message?))))
|
||||
(close fd)
|
||||
m3ua-test-result-unknown)))
|
||||
;;; (m3ua-asp-mtr-v-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends DATA including a RC.
|
||||
;;; FIXME
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-send-data))
|
||||
|
||||
|
||||
(define (m3ua-asp-mtr-v-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(let ((m (m3ua-wait-for-message fd (lambda (m) (or (m3ua-data-message? m)
|
||||
(m3ua-daud-message? m))))))
|
||||
(if (m3ua-daud-message? m)
|
||||
(begin
|
||||
(m3ua-send-message fd 0 (m3ua-make-dava-message (m3ua-get-parameters m)))
|
||||
(m3ua-wait-for-message fd m3ua-data-message?))))
|
||||
(close fd)
|
||||
m3ua-test-result-unknown)))
|
||||
;;; (m3ua-asp-mtr-v-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends DATA including data.
|
||||
;;; FIXME
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-send-data))
|
||||
|
||||
|
||||
(define (m3ua-asp-mtr-v-003 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(let ((m (m3ua-wait-for-message fd (lambda (m) (or (m3ua-data-message? m)
|
||||
(m3ua-daud-message? m))))))
|
||||
(if (m3ua-daud-message? m)
|
||||
(begin
|
||||
(m3ua-send-message fd 0 (m3ua-make-dava-message (m3ua-get-parameters m)))
|
||||
(m3ua-wait-for-message fd m3ua-data-message?))))
|
||||
(close fd)
|
||||
m3ua-test-result-unknown)))
|
||||
;;; (m3ua-asp-mtr-v-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends DATA in a valid stream .
|
||||
;;; FIXME
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-send-data))
|
||||
|
||||
|
||||
(define (m3ua-asp-mtr-i-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(m3ua-send-message fd 0 (m3ua-increment-version
|
||||
(m3ua-make-data-message 0 0 0 0 0 0 (list) (list))))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-invalid-version-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-mtr-i-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ERROR(invalid version).
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-receive-data))
|
||||
|
||||
|
||||
(define (m3ua-asp-mtr-i-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-message m3ua-reserved-message-class
|
||||
0
|
||||
(list)))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-unsupported-message-class-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-mtr-i-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ERROR(unsupported message class).
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-receive-data))
|
||||
|
||||
|
||||
(define (m3ua-asp-mtr-i-003 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-message m3ua-tfer-message-class
|
||||
m3ua-reserved-tfer-message-type
|
||||
(list)))
|
||||
(let ((msg (m3ua-wait-for-message fd m3ua-error-message?)))
|
||||
(close fd)
|
||||
(if (= (m3ua-get-error-code-from-message msg)
|
||||
m3ua-unsupported-message-type-error-code)
|
||||
m3ua-test-result-passed
|
||||
m3ua-test-result-failed)))))
|
||||
;;; (m3ua-asp-mtr-i-003 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ERROR(unsupported message type).
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active m3ua-asp-receive-data))
|
||||
|
||||
|
||||
(define (m3ua-asp-rkm-v-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((message (m3ua-wait-for-message fd m3ua-reg-req-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-reg-rsp-from-reg-req message)))
|
||||
(sleep 1)
|
||||
(close fd)))
|
||||
;;; (m3ua-asp-rkm-v-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends a valid routing key.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-send-reg-req))
|
||||
|
||||
|
||||
(define (m3ua-asp-rkm-v-003 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((reg-req (m3ua-wait-for-message fd m3ua-reg-req-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-reg-rsp-from-reg-req reg-req))
|
||||
(let ((dereg-req (m3ua-wait-for-message fd m3ua-dereg-req-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-dereg-rsp-from-dereg-req dereg-req))))
|
||||
(sleep 1)
|
||||
(close fd)))
|
||||
;;; (m3ua-asp-rkm-v-003 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends a deregistration request.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-send-reg-req m3ua-asp-send-dereg-req))
|
||||
|
||||
|
||||
(define (m3ua-asp-rkm-v-004 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((reg-req (m3ua-wait-for-message fd m3ua-reg-req-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-reg-rsp-from-reg-req reg-req))
|
||||
(let ((dereg-req (m3ua-wait-for-message fd m3ua-dereg-req-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-dereg-rsp-from-dereg-req dereg-req))))
|
||||
(sleep 1)
|
||||
(close fd)))
|
||||
;;; (m3ua-asp-rkm-v-004 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends a deregistration request with correct routing context.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-send-reg-req m3ua-asp-send-dereg-req))
|
||||
|
||||
|
||||
(define (m3ua-asp-rkm-i-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(m3ua-wait-for-message fd m3ua-reg-req-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-message m3ua-rkm-message-class
|
||||
m3ua-reserved-rkm-message-type
|
||||
(list)))
|
||||
(m3ua-wait-for-message fd m3ua-error-message?)
|
||||
(sleep 1)
|
||||
(close fd)))
|
||||
;;; (m3ua-asp-rkm-i-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ERROR(unsupported message type).
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-send-reg-req m3ua-asp-active))
|
||||
|
||||
|
||||
(define (m3ua-asp-ssnm-001 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(m3ua-send-message fd 0 (m3ua-make-duna-message (list (m3ua-make-affected-point-code-parameter (list (list 0 tester-unavailable-pc))))))
|
||||
(m3ua-wait-for-message fd m3ua-daud-message?)
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-ssnm-001 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an DAUD.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
(define (m3ua-asp-ssnm-002 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(m3ua-send-message fd 0 (m3ua-make-duna-message (list (m3ua-make-affected-point-code-parameter (list (list 255 tester-unavailable-pc))))))
|
||||
(m3ua-wait-for-message fd m3ua-daud-message?)
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-ssnm-002 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an DAUD.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
(define (m3ua-asp-ssnm-003 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(m3ua-send-message fd 0 (m3ua-make-drst-message (list (m3ua-make-affected-point-code-parameter (list (list 0 tester-restricted-pc))))))
|
||||
(m3ua-wait-for-message fd m3ua-daud-message?)
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-ssnm-003 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an DAUD.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
(define (m3ua-asp-ssnm-004 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(m3ua-send-message fd 0 (m3ua-make-drst-message (list (m3ua-make-affected-point-code-parameter (list (list 255 tester-restricted-pc))))))
|
||||
(m3ua-wait-for-message fd m3ua-daud-message?)
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-ssnm-004 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an DAUD.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
(define (m3ua-asp-ssnm-005 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(m3ua-send-message fd 0 (m3ua-make-scon-message (list (m3ua-make-affected-point-code-parameter (list (list 0 tester-congested-pc))))))
|
||||
(m3ua-wait-for-message fd m3ua-daud-message?)
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-ssnm-005 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an DAUD.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
(define (m3ua-asp-ssnm-006 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(m3ua-send-message fd 0 (m3ua-make-scon-message (list (m3ua-make-affected-point-code-parameter (list (list 255 tester-congested-pc))))))
|
||||
(m3ua-wait-for-message fd m3ua-daud-message?)
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-ssnm-006 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an DAUD.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
(define (m3ua-asp-ssnm-007 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(m3ua-send-message fd 0 (m3ua-make-dupu-message (list (m3ua-make-affected-point-code-parameter (list (list 0 tester-congested-pc)))
|
||||
(m3ua-make-user-cause-parameter m3ua-mtp-user-isup m3ua-unequipped-remote-user-cause))))
|
||||
(m3ua-wait-for-message fd m3ua-daud-message?)
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-ssnm-006 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an DAUD.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
||||
|
||||
(define (m3ua-asp-ssnm-008 tester-addr tester-port sut-addr sut-port)
|
||||
(let ((fd (m3ua-accept tester-addr tester-port)))
|
||||
(m3ua-wait-for-message fd m3ua-asp-up-message?)
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-up-ack-message))
|
||||
(let ((asp-active (m3ua-wait-for-message fd m3ua-asp-active-message?)))
|
||||
(m3ua-send-message fd 0 (m3ua-make-asp-active-ack-message (m3ua-get-parameters asp-active))))
|
||||
(m3ua-send-message fd 0 (m3ua-make-dupu-message (list (m3ua-make-affected-point-code-parameter (list (list 255 tester-congested-pc)))
|
||||
(m3ua-make-user-cause-parameter m3ua-mtp-user-isup m3ua-unequipped-remote-user-cause))))
|
||||
(m3ua-wait-for-message fd m3ua-error-message?)
|
||||
(close fd)
|
||||
m3ua-test-result-passed))
|
||||
;;; (m3ua-asp-ssnm-006 tester-addr tester-port sut-addr sut-port)
|
||||
;;; This test is passed iff the SUT sends an ERROR.
|
||||
;;; (m3ua-run-asp tester-addr (list m3ua-asp-inactive m3ua-asp-active))
|
|
@ -0,0 +1,137 @@
|
|||
;;;
|
||||
;;; Copyright (C) 2004, 2005 M. Tuexen tuexen@fh-muenster.de
|
||||
;;;
|
||||
;;; All rights reserved.
|
||||
;;;
|
||||
;;; Redistribution and use in source and binary forms, with or
|
||||
;;; without modification, are permitted provided that the
|
||||
;;; following conditions are met:
|
||||
;;; 1. Redistributions of source code must retain the above
|
||||
;;; copyright notice, this list of conditions and the
|
||||
;;; following disclaimer.
|
||||
;;; 2. Redistributions in binary form must reproduce the
|
||||
;;; above copyright notice, this list of conditions and
|
||||
;;; the following disclaimer in the documentation and/or
|
||||
;;; other materials provided with the distribution.
|
||||
;;; 3. Neither the name of the project nor the names of
|
||||
;;; its contributors may be used to endorse or promote
|
||||
;;; products derived from this software without specific
|
||||
;;; prior written permission.
|
||||
;;;
|
||||
;;; THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS
|
||||
;;; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
;;; BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
;;; DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS
|
||||
;;; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
;;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
;;; IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
;;; OF SUCH DAMAGE.
|
||||
|
||||
;;; $Id: m3ua-param-testtool.scm,v 1.5 2012/08/28 19:56:13 tuexen Exp $
|
||||
|
||||
;;; Define a transport address of the system under test
|
||||
(define sut-addr "127.0.0.1")
|
||||
(define sut-port 0)
|
||||
(define sut-port-1 0)
|
||||
(define sut-port-2 0)
|
||||
|
||||
;;; Define the transport address of the tester
|
||||
(define tester-addr "127.0.0.1")
|
||||
|
||||
(define tester-port m3ua-port)
|
||||
(define tester-port-1 3000)
|
||||
(define tester-port-2 3001)
|
||||
|
||||
;;; Define the point code of the IUT
|
||||
(define iut-pc 4001)
|
||||
|
||||
;;; Define the point code of the tester
|
||||
(define tester-pc 100)
|
||||
(define tester-pc-1 100)
|
||||
(define tester-pc-2 101)
|
||||
(define tester-invalid-pc 102)
|
||||
(define tester-unauthorized-pc 103)
|
||||
(define tester-unprovisioned-pc 104)
|
||||
(define tester-unavailable-pc 1234)
|
||||
(define tester-available-pc 1235)
|
||||
(define tester-congested-pc 1236)
|
||||
(define tester-restricted-pc 1237)
|
||||
|
||||
;;; Define a valid SS7 message and SI
|
||||
(define ss7-message (list 11 34 45 67 67 89))
|
||||
(define ss7-si 0)
|
||||
|
||||
(define iut-ni 1)
|
||||
(define iut-mp 0)
|
||||
(define iut-sls 0)
|
||||
|
||||
|
||||
;;; Define correlation id
|
||||
(define correlation-id 1)
|
||||
|
||||
;;; Define network appearance
|
||||
(define network-appearance 1)
|
||||
(define invalid-network-appearance 2)
|
||||
|
||||
;;; Define an routing context
|
||||
(define tester-rc-valid 1)
|
||||
(define tester-rc-valid-1 1)
|
||||
(define tester-rc-valid-2 2)
|
||||
|
||||
;;; Define an invalid routing context
|
||||
(define tester-rc-invalid 3)
|
||||
|
||||
;;; Define an asp-identifier
|
||||
(define asp-id 1)
|
||||
(define asp-id-1 1)
|
||||
(define asp-id-2 2)
|
||||
|
||||
;;; Define traffic-type-mode
|
||||
;;;(define traffic-mode m3ua-traffic-mode-type-override)
|
||||
(define traffic-mode m3ua-traffic-mode-type-loadshare)
|
||||
;;;(define traffic-mode m3ua-traffic-mode-type-broadcast)
|
||||
|
||||
(define asp-up-message-parameters (list))
|
||||
;;; (define asp-up-message-parameters (list (m3ua-make-asp-id-parameter asp-id)))
|
||||
;;;asp-up-message-parameters
|
||||
|
||||
(define asp-active-message-parameters (list))
|
||||
;;;(define asp-active-message-parameters (list (m3ua-make-traffic-mode-type-parameter traffic-mode)
|
||||
;;; (m3ua-make-routing-context-parameter (list tester-rc-valid))))
|
||||
;;;asp-active-message-parameters
|
||||
|
||||
(define asp-active-ack-message-parameters (list))
|
||||
;;;(define asp-active-ack-message-parameters (list (m3ua-make-traffic-mode-type-parameter traffic-mode)
|
||||
;;; (m3ua-make-routing-context-parameter (list tester-rc-valid))))
|
||||
;;;asp-active-ack-message-parameters
|
||||
|
||||
(define asp-inactive-message-parameters (list))
|
||||
;;;(define asp-inactive-message-parameters (list (m3ua-make-traffic-mode-type-parameter traffic-mode)
|
||||
;;; (m3ua-make-routing-context-parameter (list tester-rc-valid))))
|
||||
;;;asp-inactive-message-parameters
|
||||
(define asp-inactive-ack-message-parameters (list))
|
||||
;;;(define asp-inactive-ack-message-parameters (list (m3ua-make-routing-context-parameter (list tester-rc-valid))))
|
||||
;;;asp-inactive-ack-message-parameters
|
||||
|
||||
(define data-message-parameters (list))
|
||||
;;;(define data-message-parameters (list (m3ua-make-network-appearance-parameter network-appearance)
|
||||
;;; (m3ua-make-routing-context-parameter (list tester-rc-valid))))
|
||||
;;;data-message-parameters
|
||||
|
||||
;;; Define parameter for DATA message
|
||||
(define rc 1)
|
||||
(define opc 1)
|
||||
(define dpc 2)
|
||||
(define si 0)
|
||||
(define sls 0)
|
||||
(define ni 0)
|
||||
(define mp 0)
|
||||
(define ss7-message (list 11 34 45 67 67 89))
|
||||
(define data-message-parameters (list (m3ua-make-routing-context-parameter (list rc))))
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,20 @@
|
|||
#!/bin/tcsh
|
||||
|
||||
set timeout = 10
|
||||
set sleeptime = 1
|
||||
|
||||
set testcases = (m3ua-asp-aspsm-v-002 \
|
||||
m3ua-asp-aspsm-i-001 \
|
||||
m3ua-asp-aspsm-i-003 \
|
||||
m3ua-asp-aspsm-o-001 \
|
||||
m3ua-asp-aspsm-o-002 \
|
||||
m3ua-asp-asptm-v-001 \
|
||||
m3ua-asp-asptm-v-008 \
|
||||
m3ua-asp-asptm-i-003 \
|
||||
m3ua-asp-asptm-o-001 \
|
||||
m3ua-asp-mtr-i-002 )
|
||||
|
||||
foreach testcase ($testcases)
|
||||
(runm3uatest -t $timeout $testcase > /dev/tty) >& /dev/null
|
||||
sleep $sleeptime
|
||||
end
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/tcsh
|
||||
|
||||
set timeout = 10
|
||||
set sleeptime = 1
|
||||
|
||||
set testcases = (m3ua-sgp-aspsm-v-003 \
|
||||
m3ua-sgp-aspsm-i-001 \
|
||||
m3ua-sgp-aspsm-i-002 \
|
||||
m3ua-sgp-aspsm-i-003 \
|
||||
m3ua-sgp-aspsm-o-001 \
|
||||
m3ua-sgp-asptm-v-003 \
|
||||
m3ua-sgp-asptm-v-008 \
|
||||
m3ua-sgp-asptm-v-011 \
|
||||
m3ua-sgp-asptm-i-004 \
|
||||
m3ua-sgp-asptm-o-001)
|
||||
|
||||
foreach testcase ($testcases)
|
||||
(runm3uatest -t $timeout $testcase > /dev/tty) >& /dev/null
|
||||
sleep $sleeptime
|
||||
end
|
|
@ -0,0 +1,146 @@
|
|||
/*-
|
||||
* Copyright (c) 2009 Michael Tuexen tuexen@fh-muenster.de
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: runm3uatest.c,v 1.8 2012/08/25 23:41:55 tuexen Exp $
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#define TIMEOUT 0
|
||||
#define COMMAND_LENGTH 2048
|
||||
|
||||
#define RED(string) "\033[31m"string"\033[0m"
|
||||
#define GREEN(string) "\033[32m"string"\033[0m"
|
||||
#define YELLOW(string) "\033[33m"string"\033[0m"
|
||||
#define BLUE(string) "\033[34m"string"\033[0m"
|
||||
|
||||
char command_skel[] =
|
||||
"(load-from-path \"%s/.guile\")"
|
||||
"(let ((test-name \"%s\"))"
|
||||
" (if (defined? (string->symbol test-name))"
|
||||
" (exit ((eval-string test-name)"
|
||||
" tester-addr tester-port sut-addr sut-port))"
|
||||
" (exit 254)))";
|
||||
|
||||
char usage[] =
|
||||
"Usage: runm3uatest [options] testname\n"
|
||||
"Options:\n"
|
||||
" -h display this help\n"
|
||||
" -t time maximum runtime in seconds (default: no limit)\n";
|
||||
|
||||
pid_t pid;
|
||||
|
||||
void
|
||||
handler(int n) {
|
||||
kill(pid, SIGKILL);
|
||||
}
|
||||
|
||||
void
|
||||
print_usage() {
|
||||
fprintf(stderr, "%s", usage);
|
||||
}
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
unsigned int timeout;
|
||||
int status, c;
|
||||
char command[COMMAND_LENGTH];
|
||||
|
||||
timeout = TIMEOUT;
|
||||
|
||||
while ((c = getopt(argc, argv, "t:")) != -1) {
|
||||
switch(c) {
|
||||
case 'h':
|
||||
print_usage();
|
||||
return (0);
|
||||
break;
|
||||
case 't':
|
||||
timeout = (unsigned int)atoi(optarg);
|
||||
break;
|
||||
default:
|
||||
print_usage();
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind == argc - 1) {
|
||||
snprintf(command, COMMAND_LENGTH, command_skel, getenv("HOME"), argv[optind]);
|
||||
} else {
|
||||
print_usage();
|
||||
return (1);
|
||||
}
|
||||
|
||||
if ((pid = fork()) == 0) {
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||
execlp("/usr/local/bin/guile", "guile", "-c", command, NULL);
|
||||
#else
|
||||
execlp("/usr/bin/guile", "guile", "-c", command, NULL);
|
||||
#endif
|
||||
return (255);
|
||||
}
|
||||
printf("Test %-40.40s ", argv[optind]);
|
||||
fflush(stdout);
|
||||
if (timeout > 0) {
|
||||
signal(SIGALRM, handler);
|
||||
alarm(timeout);
|
||||
}
|
||||
|
||||
if (wait(&status) == -1) {
|
||||
fprintf(stderr, "%s\n", "Couldn't start guile.");
|
||||
return (1);
|
||||
}
|
||||
if (WIFSIGNALED(status)) {
|
||||
printf("%-29.29s\n", YELLOW("TIMEOUT"));
|
||||
} else {
|
||||
switch (WEXITSTATUS(status)) {
|
||||
case 0:
|
||||
printf("%-29.29s\n", GREEN("PASSED"));
|
||||
break;
|
||||
case 1:
|
||||
printf("%-29.29s\n", RED("FAILED"));
|
||||
break;
|
||||
case 2:
|
||||
printf("%-29.29s\n", YELLOW("UNKNOWN"));
|
||||
break;
|
||||
case 253:
|
||||
printf("%-29.29s\n", BLUE("NON-APPLICABLE"));
|
||||
break;
|
||||
case 254:
|
||||
printf("%-29.29s\n", YELLOW("NON-EXISTENT"));
|
||||
break;
|
||||
case 255:
|
||||
printf("%-29.29s\n", YELLOW("COULDN'T START GUILE"));
|
||||
break;
|
||||
default:
|
||||
printf("%-29.29s\n", YELLOW("BUG"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
Loading…
Reference in New Issue