diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a1ff334be..2c13221db 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -241,32 +241,32 @@ jobs: ACCEPTANCE_SET: lastseqnumprocessed run: make generate-ci && make build && make $FIX_TEST - # nextexpectedseqnum: - # name: NextExpectedSeqNum Suite - # runs-on: ubuntu-latest - # strategy: - # matrix: - # go: [1.21] - # fix-version: - # - fix44 - # - fix50 - # - fix50sp1 - # - fix50sp2 - # steps: - # - name: Setup - # uses: actions/setup-go@v2 - # with: - # go-version: ${{ matrix.go }} - # - name: Check out source - # uses: actions/checkout@v2 - # - name: Install ruby - # uses: ruby/setup-ruby@v1 - # with: - # ruby-version: '3.0' - # - name: Acceptance test - # env: - # GO111MODULE: on - # FIX_TEST: ${{ matrix.fix-version }} - # STORE_TYPE: memory - # ACCEPTANCE_SET: nextexpectedseqnum - # run: make generate-ci && make build && make $FIX_TEST \ No newline at end of file + nextexpectedseqnum: + name: NextExpectedSeqNum Suite + runs-on: ubuntu-latest + strategy: + matrix: + go: [1.21] + fix-version: + - fix44 + - fix50 + - fix50sp1 + - fix50sp2 + steps: + - name: Setup + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - name: Check out source + uses: actions/checkout@v2 + - name: Install ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + - name: Acceptance test + env: + GO111MODULE: on + FIX_TEST: ${{ matrix.fix-version }} + STORE_TYPE: memory + ACCEPTANCE_SET: nextexpectedseqnum + run: make generate-ci && make build && make $FIX_TEST \ No newline at end of file diff --git a/_test/Reflector.rb b/_test/Reflector.rb index fe9535f39..3e86af7a1 100644 --- a/_test/Reflector.rb +++ b/_test/Reflector.rb @@ -61,6 +61,8 @@ def processLine(lineNum, line, body, cid) connectAction(cid) elsif body == "DISCONNECT" disconnectAction(cid) + elsif body.index("SET_SESSION") == 0 + setSeqnum(body) else raise "Syntax error: " + body end diff --git a/_test/ReflectorClient.rb b/_test/ReflectorClient.rb index acc8acc72..148867b40 100644 --- a/_test/ReflectorClient.rb +++ b/_test/ReflectorClient.rb @@ -19,6 +19,8 @@ require 'Reflector' require 'FixParser' require "socket" +require 'uri' +require 'net/http' class ReflectorClient @@ -62,6 +64,12 @@ def @reflector.disconnectAction(cid) @sockets.delete(cid) @parsers.delete(cid) end + + def @reflector.setSeqnum(body) + left_array = body.split(" ") + uri = URI('http://localhost:8095/seqnum?SESSION='+left_array[1]+'&'+left_array[2]) + Net::HTTP.get_response(uri) + end def @reflector.waitConnectAction(cid) end diff --git a/_test/cfg/nextexpectedseqnum/fix44.cfg b/_test/cfg/nextexpectedseqnum/fix44.cfg new file mode 100644 index 000000000..b31219439 --- /dev/null +++ b/_test/cfg/nextexpectedseqnum/fix44.cfg @@ -0,0 +1,10 @@ +[DEFAULT] +SocketAcceptPort=5005 +SenderCompID=ISLD +TargetCompID=TW +FileLogPath=tmp + +[SESSION] +BeginString=FIX.4.4 +DataDictionary=../spec/FIX44.xml +EnableNextExpectedMsgSeqNum=Y diff --git a/_test/cfg/nextexpectedseqnum/fix50.cfg b/_test/cfg/nextexpectedseqnum/fix50.cfg new file mode 100644 index 000000000..c60f608e2 --- /dev/null +++ b/_test/cfg/nextexpectedseqnum/fix50.cfg @@ -0,0 +1,12 @@ +[DEFAULT] +SocketAcceptPort=5006 +SenderCompID=ISLD +TargetCompID=TW +FileLogPath=tmp + +[SESSION] +BeginString=FIXT.1.1 +DefaultApplVerID=FIX.5.0 +TransportDataDictionary=../spec/FIXT11.xml +AppDataDictionary=../spec/FIX50.xml +EnableNextExpectedMsgSeqNum=Y diff --git a/_test/cfg/nextexpectedseqnum/fix50sp1.cfg b/_test/cfg/nextexpectedseqnum/fix50sp1.cfg new file mode 100644 index 000000000..f1ec2103b --- /dev/null +++ b/_test/cfg/nextexpectedseqnum/fix50sp1.cfg @@ -0,0 +1,12 @@ +[DEFAULT] +SocketAcceptPort=5007 +SenderCompID=ISLD +TargetCompID=TW +FileLogPath=tmp + +[SESSION] +BeginString=FIXT.1.1 +DefaultApplVerID=FIX.5.0SP1 +TransportDataDictionary=../spec/FIXT11.xml +AppDataDictionary=../spec/FIX50SP1.xml +EnableNextExpectedMsgSeqNum=Y diff --git a/_test/cfg/nextexpectedseqnum/fix50sp2.cfg b/_test/cfg/nextexpectedseqnum/fix50sp2.cfg new file mode 100644 index 000000000..4a1db4eef --- /dev/null +++ b/_test/cfg/nextexpectedseqnum/fix50sp2.cfg @@ -0,0 +1,12 @@ +[DEFAULT] +SocketAcceptPort=5008 +SenderCompID=ISLD +TargetCompID=TW +FileLogPath=tmp + +[SESSION] +BeginString=FIXT.1.1 +DefaultApplVerID=FIX.5.0SP2 +TransportDataDictionary=../spec/FIXT11.xml +AppDataDictionary=../spec/FIX50SP2.xml +EnableNextExpectedMsgSeqNum=Y diff --git a/_test/definitions/nextexpectedseqnum/fix44/2a_NextExpectedMsgSeqNumCorrect.def b/_test/definitions/nextexpectedseqnum/fix44/2a_NextExpectedMsgSeqNumCorrect.def new file mode 100644 index 000000000..3cadb8ca2 --- /dev/null +++ b/_test/definitions/nextexpectedseqnum/fix44/2a_NextExpectedMsgSeqNumCorrect.def @@ -0,0 +1,16 @@ +iCONNECT + +#------------------------ +# logon message and response +# send logon with sequence number equals to 1 +# expect for a logon response with NextExpectedMsgSeqNum field equals to 2 +#------------------------ + +I8=FIX.4.435=A34=149=TW52=