40 Commits

Author SHA1 Message Date
Jürgen Eckel
e99b614e4a
added connection loss handler, extended logging, mqtt msg updates (#400)
* added a bit of logging
* added update messages to mqtt (every second with a timestamp)
* added isConnectionOpen to the interface and analysis this during execution
* added connection loss handler and status check
* put some global objects into an objects to avoid inter service testing issues
* TestingLocker Mutex to RWMutex (increase performance)
* termintationMutex became a sync.RWMutex
* added logging to the mqtt mock client
* made monitor Mutex a RWMutex
* added Mutex protection to the numberOfElements varialbe
* added another Waiting block to the machine attestation methods (CI tests)
* had to adjust the test cases to the impact of that change.

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-05-16 17:06:19 +02:00
Jürgen Eckel
43d152fcf6
Donate tokens to attested machines so that these are able to run after their attestation (#375)
* added donation of tokens/denom to the just attestet machine
* extended the machine module to have two additional parameters: amount of tokens to be distributed and their denominator

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-04-23 12:00:31 +02:00
Lorenz Herzberger
5e2b307a70
368 make attestmachine msgtx with fee=zero (#372)
* no fee deduction in case of machineattestation messages
* no gas price for machineattestations in lib/tx
* test: add balance check to machine attestation e2e test

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-04-22 13:07:40 +02:00
Jürgen Eckel
1e1e19bb19
added more sync objects to avoid accidential data races (#345)
* Added more sync objects to avoid accidental data races
* made lib.config.Config variables are private, so they cannot be tampered with (multithreading).
Please introduce Get-methods to retrieve the varialbes outside of the package if you need it.
This way, the race conditions and unexpected change of the global object state can be protected
* added reverse takedown of the validators to avoid the following error
 [app] PoP broadcast tx failed: node0.info: key not found
* moved util.TerminationWaitGroup.Wait()
to the central network cleanup method
* removed mappings for private variables


Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-03-11 11:11:56 +01:00
Jürgen Eckel
d5d86997f3
added wait for another block to have more reliable tests (#344)
* added wait for another block to have more reliable tests
* Added one network reload in case the address/port was still bound during the last try
test related

* separated Dao test suites (faster output on the CI)
* added 2 seconds wait time to avoid errors of still blocked ports/bindings (network)
* removed parallel flag from test/e2e/asset
* renamed a bunch of things to please the linters
* moved the reset of the libConfing clientctx back to the validator context before waiting for some blocks.
This should prevent the

panic: Log in goroutine after TestE2EMachineTestSuite has completed: [app] PoP broadcast tx failed: node0.info: key not found

on the CI.


Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-03-08 15:14:36 +01:00
Jürgen Eckel
e6f6e43754
fixed crashes when two machines are attested at the same time (#343)
* * added creation of random machines to prepare a test case
* setting all the consensus timeout values at once (if changed)
* mutex protection of the elements tx crafting methods (sequential processing)
* Extending the TestMachineNFTIssuance test case to parallel threads and threading issues
* moving all elements-rpc usage to the elementd-connector.go file
* removed call to fatal
* added WaitForNextBlock to be out of sync with PoP to avoid the following error
                PoP broadcast tx failed: node0.info: key not found
  after the test
---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-03-08 10:54:52 +01:00
Jürgen Eckel
31b304f232
added TermintionWaitGroup (#336)
* added TermintionWaitGroup
* added mutex to lib/tx
* removed machine attestation thread (to comply with testing-race conditions becoming apparent on the CI)
* renamed test suites to have a clear naming structure
* removed parallel-testing from e2e machine test suite
* improved test suite logging
* removed parallel tests of machine_nft_tests - this caused data races due to the mock overwrites
* reduced error check to "out of gas" due to multi-threading and locking  delays that result in different gas consumptions
* Added waiting blocks to pass the CI

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-03-06 10:52:22 +01:00
Jürgen Eckel
75ed13b357
Eckelj/reducing code smell (#325)
* aggregating error messages
* removed duplicate err msgs
* removed obsolete test (two times equal behaviour )
* added global error msg module
* refactored test utils to have sample types and sample objects by keepers separated
* excluded auto-generated code from sonarcube analysis


Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-26 16:44:00 +01:00
Jürgen Eckel
04e45a7fb2
275 refactor feedenom on e2e test suite (#312)
* extended AttestMachine FundAccount to support a given fee denominator
* renamed testutil/network/network.go to testutil/network/loader.go
* renamed new to Load
* integrated cosmos/testutil/network to planetmint-go/testutil/network
* changed to plmnt token tests only!
* removed obsolete variables
* fixed newest linter issues

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-14 12:15:40 +01:00
Jürgen Eckel
a29f394bc4
192 migrate config params to on chain module params (#307)
* initial refactoring commit
* added config passing to network creation for some test suits
* fixed refactoring issues
* adjusted params

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-01-30 16:12:04 +01:00
Julian Strobl
6d05f85cbd
Use lib in rest e2e machine test (#263)
* refactor: align variable name with rest of the code

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-09 10:14:54 +01:00
Julian Strobl
ae161f11e5
refactor: let lib set client context's address and name (#261)
* fix: make a real copy of bytes.Buffer

* refactor: rename `address` for maximum clarity in lib

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-08 16:04:42 +01:00
Julian Strobl
3e23260a9c
test: refactor broadcast tx into function (#259)
Force test cases to check tx response for errors.

* refactor: improve broadcast error logging

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-05 13:43:52 +01:00
Lorenz Herzberger
6bff8e835d
Split up e2e test suites to run separately (#256)
* refactor: Split up machine e2e test suites

* refactor: move CreateAccount and FundAccount to testutil/e2e

* refactor: add AttestMachine to testutil/e2e

* refactor: split up asset e2e test suites

* refactor: make use of testutil in e2e dao suite

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-04 07:43:01 +01:00
Julian Strobl
f957f540a1
Refactor lib (#254)
* refactor: remove unwanted function in `lib`

The `lib` shall always be used with file lock.

* refactor: log `txResponse` in `buildSignBroadcastTx`

- Move `GetTxResponseFromOut` from `testutil` to `lib`

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-03 10:41:09 +01:00
Julian Strobl
036ce7cbc1
Enable sequence file locking in tests (#236)
* [lib] Add `FeeGranter` to tx factory
* [lib] Align return value with test cases
* [test] Return error on tx response
* [test] Switch to sequence file locking via libRPC
* [test] Reintegrate `TestPoPResult`

Closes #234


Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-18 15:47:44 +01:00
Julian Strobl
487dc3b93c
[test] Check TxResponse on every ExecTestCLICmd() (#235)
Just a small improvement to not forget to check the error code of the
transaction and not only from the command itself.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-15 11:32:29 +01:00
Lorenz Herzberger
c8bfb861f1
add machine allowance e2e test (#166)
* add machine allowance e2e test

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>

* fix linter errors

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-11-09 15:47:41 +01:00
Lorenz Herzberger
e80ce7e894
remove duplicate validation (#102)
* remove duplicate validation
* add e2e test for antehandler checks on invalid machine attestation requests
* added comment
* adjusted openapi docs

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-09-29 09:09:27 +02:00
Jürgen Eckel
8fd9f213f3
77 rename asset hash to asset cid (#97)
* initial asset notarization restructuring
* adjusted test cases, two are still failing
* removed obsolete data structures

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-09-27 16:35:31 +02:00
Julian Strobl
d4eed021c8
[go.mod] Switch module to github.com (#86)
This is the quasi-standard and fixes the error below:

```
$ go get -u github.com/planetmint/planetmint-go@v0.1.0
go: github.com/planetmint/planetmint-go@v0.1.0: parsing go.mod:
        module declares its path as: planetmint-go
                but was required as: github.com/planetmint/planetmint-go
```

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-09-21 17:37:57 +02:00
Lorenz Herzberger
6c7ccd47ee
remove comment
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-06 16:16:40 +02:00
Lorenz Herzberger
e33452476f
adjust test suite for ta validation
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-06 15:13:06 +02:00
Lorenz Herzberger
b1f572ddee
update machine message
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-06 11:41:54 +02:00
Jürgen Eckel
1a5d673a86
adjusted the default derivation path for the test cases to planetmint… (#59)
* adjusted the default derivation path for the test cases to planetmint cointype

* [test] Update sample.PubKey

Changed due to updated derivation path.

* [test] Set comment for DefaultDerivationPath

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Co-authored-by: Julian Strobl <jmastr@mailbox.org>
2023-08-03 09:48:03 +02:00
Julian Strobl
9fe804ee2f
[test] Add more asserts to test cases
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-07-21 08:04:51 +02:00
Julian Strobl
a97d1126f9
[tests] DRY
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-07-19 16:34:42 +02:00
Julian Strobl
18ce58f139
[tests] Use sample.Machine()
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-07-19 16:34:42 +02:00
Julian Strobl
5a435575b5
[lint] Fix some errors
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-07-19 15:53:42 +02:00
Lorenz Herzberger
c1389ea931
implement TestAttestMachineREST
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-12 15:24:33 +02:00
Lorenz Herzberger
24511388d2
query machine in test
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-12 13:30:58 +02:00
Lorenz Herzberger
ee4f2bfda0
issue tx over e2e rest test
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-12 10:57:18 +02:00
Lorenz Herzberger
acdccc1029
add comments for audit
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-06 14:10:23 +02:00
Julian Strobl
9837d1d1aa
[test] Improve readability a bit
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-07-06 13:26:40 +02:00
Julian Strobl
06688a8ad0
[test] Use machine struct and marshal it to JSON
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-07-06 13:18:18 +02:00
Lorenz Herzberger
e1a153b2fa
add comment to bank transfer
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-06 12:53:35 +02:00
Lorenz Herzberger
5a195c8f5a
cleanup
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-06 11:46:48 +02:00
Lorenz Herzberger
d65600bf90
fix setup suite
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-06 11:07:16 +02:00
Lorenz Herzberger
a7d953dc1a
implement basic attest machine e2e test case
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-05 10:41:33 +02:00
Lorenz Herzberger
0a26962e0b
implement first e2e test setup
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-04 14:00:17 +02:00