Commit Graph

874 Commits

Author SHA1 Message Date
Peter Barker c7fe8f7c33 autotest: add test for transitioning with disabled airspeed sensor 2023-02-28 21:43:09 +11:00
Peter Barker 1e325d4aaa autotest: remove default value for paramValue in setGCSfailsafe
All callers were supplying a value, and it isn't clear why zero makes a
good default.
2023-02-26 17:31:11 +11:00
Pierre Kancir 0b7ef942b4 Tools: move setGCSfailsafe in common 2023-02-24 09:41:17 -08:00
Peter Barker df06e85450 autotest: fix arming checks test
waity for accels/gyros to settle
2023-02-24 09:21:42 +11:00
Peter Barker 8ce904559d autotest: correct armable time calculation 2023-02-24 09:21:42 +11:00
Tom Pittenger 617da9a873 Tools/autotest: add JUMP_TAG support 2023-02-22 05:33:38 -08:00
Peter Barker f5bda98a05 autotest: adjust for new emission of IN_PROGRESS mavlink messages
ignored for the most part, but explicit test added that we receive one when doing cal
2023-02-21 17:07:41 +11:00
Peter Barker 1aabcbd4b9 autotest: add more install-script-in-context methods 2023-02-17 12:54:49 +11:00
Peter Barker d426c73d0e autotest: rename context's example_scripts to installed_scripts 2023-02-17 12:54:49 +11:00
Peter Barker 69b8e30f28 autotest: rename remove_example_script to remove_installed_script 2023-02-17 12:54:49 +11:00
Peter Barker 6678689312 autotest: add install_example_script_context 2023-02-16 11:57:18 +11:00
Peter Barker 13e3556e18 autotest: document SIM_ESC_TELEM 2023-01-18 18:07:23 +11:00
Peter Barker 8e33476bfd autotest: test EPM gripper 2023-01-18 10:09:23 +11:00
Peter Barker ccd700a990 autotest: fix whitelisted parameter list
move to whitelist crossed with another PR which breaks CI
2023-01-17 21:19:49 +11:00
Peter Barker d533517fc4 autotest: create whitelist for undocumented SIM_ parameters
Rather than creating a blanket exception for SIM_ parameters, have a whitelist of known-undocumented parameters.

This will create a ratchet where new SIM_ parameters must be documented.
2023-01-17 11:23:40 +11:00
Henry Wurzburg 8806088404 Tools: make MAG params consistent names 2023-01-17 08:45:30 +11:00
Peter Barker b441c24eaa autotest: use percentage error when determining if z is preserved
floating point storage means an absolute error doesn't work
2023-01-14 23:23:29 +11:00
Peter Barker 128a6430de autotest: add test for AHRS backend wind estimates 2023-01-04 12:30:27 +11:00
Iampete1 7b171867af Tools: autotest: set new ARSPD_ENABLE param where needed 2023-01-03 10:17:56 +11:00
Peter Barker 7d38164176 autotest: add simple test for LoiterAltQLand 2022-12-31 10:58:19 +11:00
Leonard Hall fea86f78ca AutoTest: Increase mission timeout to account for lower corner acceleration 2022-12-30 17:03:32 +09:00
Peter Barker 021cb75d5b Tools: autotest: use forced reboot argument 2022-12-06 11:20:08 +11:00
Peter Barker dcf41f2396 autotest: add additional tests for private channels 2022-11-29 10:32:02 +11:00
Peter Barker d1cff53ba1 autotest: add test for mavlink private-channel 2022-11-29 10:32:02 +11:00
Andrew Tridgell 76b83c3d57 autotest: fixed aerobatics test for new Schedules location 2022-11-28 10:40:50 +11:00
Henry Wurzburg ef65274b9c Tools: add synthetic current sensor,fix SITL current 2022-11-24 06:53:35 +11:00
Andrew Tridgell 0abeca15e2 autotest: added scripting aerobatics test 2022-11-10 13:53:15 +11:00
Peter Barker 8777d68ac1 autotest: drain self.mav while waiting on other link
In the short period of time it takes for us to get organised/draining mavlink connections, the ArduPilot process might block writing to the primary mavlink connection - in which case we'll never get the message we requested.

Should solve

2022-08-31T23:17:43.6904119Z AT-0227.6: waiting for a message - any message....
2022-08-31T23:17:43.6904958Z AT-0227.6: Received (ATTITUDE {time_boot_ms : 3146, roll : 0.00013471684360411018, pitch : -4.076504410477355e-05, yaw : -2.1274349689483643, rollspeed : 6.679168291157112e-05, pitchspeed : 3.297374496469274e-05, yawspeed : 9.125166684498254e-07})
2022-08-31T23:17:43.6905505Z AT-0227.6: Waiting for mission count of (3) from (1:1) to (243:250)
2022-08-31T23:17:43.6905909Z AT-0227.6: Asserted mission count (type=2) is 3 after 0.100000s
2022-08-31T23:17:43.6906252Z AT-0227.6: Get first item on new link
2022-08-31T23:17:43.6906620Z AT-0289.2: Received exception (Did not receive MISSION_ITEM_INT
2022-08-31T23:17:43.6907047Z Traceback (most recent call last):
2022-08-31T23:17:43.6907386Z   File "/__w/ardupilot/ardupilot/Tools/autotest/rover.py", line 3067, in test_rally
2022-08-31T23:17:43.6907719Z     m2 = self.get_mission_item_int_on_link(
2022-08-31T23:17:43.6908080Z   File "/__w/ardupilot/ardupilot/Tools/autotest/rover.py", line 2288, in get_mission_item_int_on_link
2022-08-31T23:17:43.6908469Z     raise NotAchievedException("Did not receive MISSION_ITEM_INT")
2022-08-31T23:17:43.6908841Z common.NotAchievedException: Did not receive MISSION_ITEM_INT
2022-08-31T23:17:43.6909118Z )
2022-08-31T23:17:43.6909468Z AT-0289.2: Exception caught: Did not receive MISSION_ITEM_INT
2022-11-09 09:17:08 +11:00
Peter Barker 4249fc04b7 autotest: tidy advanced failsafe test 2022-10-25 11:31:14 +11:00
Peter Barker 6d19f77325 autotest: add missing unpause_sitl() calls 2022-10-22 15:14:55 +11:00
Peter Barker cafce7671d autotest: slow down specific tests so they pass 2022-10-22 15:14:55 +11:00
Peter Barker b5cd149c1d autotest: test setting non-default-streamed message to default interval 2022-10-18 10:11:00 +11:00
Peter Barker bacbac798c autotest: add tests for embedded defaults parsing 2022-10-13 14:38:30 +11:00
Andrew Tridgell 9dd2301198 autotest: move do_aux_function to common 2022-09-30 07:44:42 +10:00
Peter Barker 0c5f972ddb autotest: add ability to watch-and-maintain from SIM_STATE.alt 2022-09-29 20:00:01 +10:00
Peter Barker 87dfd7f541 autotest: remove use of fstring
breaks under python2
2022-09-28 08:17:02 +10:00
Peter Barker 8e3021e147 autotest: check target system on return mission_item_int packets 2022-09-25 19:25:53 +10:00
Peter Barker f9bc7e44f8 autotest: add a method to easily install message printer 2022-09-22 18:14:49 +10:00
m 635df2ca45 autotest: check local home location 2022-09-21 15:58:25 +10:00
Peter Barker 267c16cd72 autotest: wait for heartbeat before determining armed state
Fixes a race condition when finishing a mission where we may receive the disarmed text but the most recent heartbeat says we are armed.
2022-09-19 17:52:18 +10:00
Peter Barker 0e9abea655 autotest: explicitly fail reboot if armed 2022-09-19 17:52:18 +10:00
m 61bb575422 autotest: Fix watch_altitude_maintained for Copter 2022-09-13 07:43:15 +10:00
Peter Barker b1909d9edf autotest: create and use a Result object to ship failure data around 2022-09-12 08:49:04 +10:00
Peter Barker ba6cf1a42b autotest: remove disabled LogUpload test
This has been unused for a long time, and is getting in the way of reforms.  Its position as a test rather than as a part of a framework was always going to cause oddities, particularly after we split the Copter tests into several chunks.
2022-09-11 20:45:13 +10:00
Peter Barker 87e97ca5b2 autotest: remove syntax test for test lambdas
We no longer permit the use of lambda functions in test lists
2022-09-11 17:21:38 +10:00
Peter Barker cd50b91904 autotest: correct running of single test
... and stop using run_tests entrypoint to the AutoTest objects as it does cause confusion
2022-09-11 17:15:53 +10:00
Peter Barker bb1c43b0a2 autotest: ensure MAVProxy arm attempt times out 2022-09-11 17:00:50 +10:00
m 3fdcf5f940 autotest: test landed state of copter during takeoff in auto mode 2022-09-10 21:53:23 +10:00
Peter Barker 80c36ecc97 autotest: use reflection to collect test details
We had a pattern emerging of using the test name as the method name to contain the actual test.  We also tended to duplicate the docstrings in the test description - or omit the docstring.

This uses reflection to retrieve both the test name and the description, meaning less duplication of this information and enforcing having docstrings on the test methods.
2022-09-10 18:27:27 +10:00
Peter Barker b06afa8316 autotest: reset sitl if forced disarm fails 2022-09-10 14:35:25 +10:00
Peter Barker 71d1c050b3 autotest: move log_name method for balancebot to within class 2022-09-09 20:32:59 +10:00
Michael du Breuil 80d7bf9b11 Tools: Update autotest to accomodate accel cal changes 2022-09-09 08:52:14 +10:00
Peter Barker a7aa5b6897 autotest: do not wait for ACK from reboot command
Several attempts have been made to make retrieving the reboot's ack reliable, and they've all failed.

So stop waiting for the ACK....
2022-08-29 08:24:03 +10:00
Peter Barker eb0f932b52 autotest: remove global variable
... progress is no longer static and hasn't been for years
2022-08-28 10:09:47 +10:00
Peter Barker 430e52a91b autotest: remove constant in target_component check when downloading mission 2022-08-26 14:38:12 +10:00
Peter Barker 2e2ffbe4ac autotest: correct reset of autoreconnect in case of exception
always true in practice
2022-08-26 14:38:12 +10:00
Peter Barker b6c4930b3a autotest: explicltly dis/reconnect when customising commandline
We *know* the connection is going away, so wecan force the reconnect rather than waiting for mavtcp's reconnect logic to kick in
2022-08-26 14:38:12 +10:00
Peter Barker 8b5afb4a24 autotest: loop across recv_match in assert_receive_message
pymavlink sleeps for half the passed-in timeout which is no good if we are willing to wait for 30 seconds for a message!
2022-08-24 10:08:27 +10:00
Peter Barker 8a13fb0f6d autotest: use assert_receive_message
Removes several block-forever calls
2022-08-24 10:08:27 +10:00
Peter Barker 87eb703bc1 autotest: terminate FTP session after transfering files
race condition starting the second MAVProxy if the first session isn't terminated
2022-08-22 09:01:18 +10:00
Peter Barker af7208a65e autotest: cast packet count to floast before determining rate
Could be causing rate to be zero on autotest server
2022-08-20 21:52:20 +10:00
Peter Barker cd207164a2 autotest: correct Rover DriveMission test
4 would seem to have been just a magic number and could be missed on faster speedups
2022-08-19 17:04:54 +10:00
Peter Barker e091e8ad33 autotest: clear context before looking for GPS type
Will clarify the output as currently we look through the text messages for all of the previous gps types when trying to find the detection message for the current GPS
2022-08-17 09:57:39 +10:00
Peter Barker bd2ef2e413 autotest: pop extra contexts post-test to clean up message hooks 2022-08-17 09:57:12 +10:00
Peter Barker 00d3af6fc5 autotest: handle terrain requests internally to autotest
We will cache all required SRTM data within the autotest branch
2022-08-16 11:12:44 +10:00
Peter Barker 9f58e7df31 autotest: add test for quadplane booting in auto 2022-08-16 07:24:22 +10:00
Peter Barker bbff00dc0d autotest: be generous with mission upload timeouts
A *lot* of simulated time can pass while the Python gets its act together.  Allow a very large amount of time to pass while uploading missions.
2022-08-14 08:21:07 +10:00
Peter Barker eed9c2e38b autotest: validate kwargs to wait_and_maintain_range 2022-08-14 07:52:42 +10:00
Peter Barker fecf7c2e0c autotest: augment Plane TerrainMission to check we *do* follow the terrain 2022-08-09 14:31:14 +10:00
Peter Barker d555c49230 autotest: allow a test to override speedup
This is a crutch for poorly-behaving tests.
2022-08-08 21:33:30 +10:00
Peter Barker e92d4c6fc5 autotest: add test for WP_YAW_BEHAVIOUR 0
With behaviour 0 anbd typemask specifying ignore yaw/yaw_cds the yaw should reamin fixed
2022-08-08 21:33:03 +10:00
Peter Barker d7d473d1f9 autotest: correct assert_prearm_failure to not try to arm vehicle 2022-08-05 17:25:14 +10:00
Peter Barker f57e3668e3 autotest: do no drain mav (i.e. pause sitl) while delaying for sim time 2022-07-29 11:15:59 +10:00
Peter Barker 82bc2a7d85 autotest: adjust Plane EKF check for new configured-backend check 2022-07-28 15:53:13 +10:00
bugobliterator 2375564bb2 autotest: add test for CAN node health pre arm check 2022-07-27 18:18:03 +10:00
Peter Barker ccc25cb8d7 autotest: increase time allowed for mission download
we don't need to be particularly tight on timing here
2022-07-23 18:36:10 +10:00
Peter Barker b69a75098f autotest: avoid draining mav while waiting for motors-armed heartbeat 2022-07-23 10:56:52 +10:00
Peter Barker 82337c9058 autotest: make search of dflog for required messages faster
Doing these in parallel means we don't need to parse the large file multiple times
2022-07-22 09:13:25 +10:00
Peter Barker a306c4c506 autotest: increase timeout allowed for mavlite parameter test
the FRSky thread isn't any faster, but ArduPlane's speedup was increased.  So allow more simulated time to get the data
2022-07-21 14:31:32 +10:00
Peter Barker 3c700bdf44 autotest: disable terrain during frsky passthrough test
If terrain isn't available then our expected statustext gets blatted with one which RCTelemetry library emits
2022-07-21 14:31:32 +10:00
Peter Barker aa7987a4fb autotest: correct upload/download-mission timeouts 2022-07-21 14:31:32 +10:00
Peter Barker e27b98f47e autotest: wait for Plane to slow down after frsky test
disarming via mavlink can fail if we think we're still moving
2022-07-21 14:31:32 +10:00
Peter Barker 3e89e32d8a autotest: comment out unused context_start_custom_binary method
Broken under Python2.

Also fix some flake8 problems under flake8 under Python2
2022-07-21 09:59:40 +10:00
Peter Barker 515b79a6ca autotest: remove un-needed calls to drain_mav_unparsed
these calls are generally bad now, given we have context_collect things going on which always want to see messages coming in
2022-07-20 15:17:25 +10:00
Peter Barker a8357531d1 autotest: pause SITL process while draining mav unparsed 2022-07-20 15:17:25 +10:00
Peter Barker d2caebf39c autotest: increase time allowed for getting statustexts
frsky is run i9n a thread  - and signficiant speedsup seem to adversely affect it
2022-07-19 11:00:27 +10:00
Peter Barker 84adb059ed autotest: correct frsky text comparison bug
reusing the variable "text" here crewed up subsequent receiving of messages as it could reset the text from empty to the most recently received text.
2022-07-19 11:00:27 +10:00
Peter Barker 271b4d7d3c autotest: disable mavutil autoreconnect in drain_mav
The process may not be available
2022-07-19 11:00:27 +10:00
Peter Barker acd9fb9c0a autotest: pause/unpause SITL while draining mav
If Python can't keep up with the message volume coming from the autopilot we never manage to drain all messages from the vehicle.

So try pausing/unpausing the simulation so we can drain the link...

AT-1968.6: AP: PreArm: Radio failsafe on
AT-1969.9: AP: PreArm: Radio failsafe on
AT-1971.2: AP: PreArm: Radio failsafe on
AT-1972.4: AP: PreArm: Radio failsafe on
AT-1973.7: AP: PreArm: Radio failsafe on
AT-1974.9: AP: PreArm: Radio failsafe on
AT-1975.3: Drained 2000283 messages from mav (7218.974791/s)
AT-1975.3: Exception caught: Traceback (most recent call last):
  File "/mnt/volume_nyc3_01/autotest/APM/APM/Tools/autotest/common.py", line 699
8, in run_one_test_attempt
    self.context_pop()
  File "/mnt/volume_nyc3_01/autotest/APM/APM/Tools/autotest/common.py", line 499
3, in context_pop
    self.set_parameters(dead_parameters_dict, add_to_context=False)
2022-07-19 11:00:27 +10:00
Peter Barker e38adc7d14 autotest: pause/unpause SITL while draining mav
If Python can't keep up with the message volume coming from the autopilot we never manage to drain all messages from the vehicle.

So try pausing/unpausing the simulation so we can drain the link...

AT-1968.6: AP: PreArm: Radio failsafe on
AT-1969.9: AP: PreArm: Radio failsafe on
AT-1971.2: AP: PreArm: Radio failsafe on
AT-1972.4: AP: PreArm: Radio failsafe on
AT-1973.7: AP: PreArm: Radio failsafe on
AT-1974.9: AP: PreArm: Radio failsafe on
AT-1975.3: Drained 2000283 messages from mav (7218.974791/s)
AT-1975.3: Exception caught: Traceback (most recent call last):
  File "/mnt/volume_nyc3_01/autotest/APM/APM/Tools/autotest/common.py", line 699
8, in run_one_test_attempt
    self.context_pop()
  File "/mnt/volume_nyc3_01/autotest/APM/APM/Tools/autotest/common.py", line 499
3, in context_pop
    self.set_parameters(dead_parameters_dict, add_to_context=False)
2022-07-19 11:00:27 +10:00
Peter Barker 28ed2e3cd5 autotest: add support for building alternate binaries
e.g. adding features ordinarily compiled out
2022-07-19 09:09:05 +10:00
Peter Barker bceaa10794 autotest: add a test for rally point altitudes 2022-07-14 11:49:53 +10:00
Andrew Tridgell 2f7a8769c0 autotest: added --ubsan and --ubsan-abort to sim_vehicle.py and autotest.py
allows for undefined behaviour checking in SITL
2022-07-12 11:00:08 +10:00
Peter Barker 2ca68da77a autotest: correct setting mode by number 2022-07-12 08:51:21 +10:00
Peter Barker 7647e38f3f autotest: create get_home_tuple_from_mission method
Useful if you want to start a mission where a saved waypoint file's home location is
2022-07-10 20:59:52 +10:00
Peter Barker 86096261d0 autotest: add new wait_and_maintain_range method 2022-07-07 21:29:43 +10:00
Peter Barker 215842fe82 Tools: add tests for ICE Planes 2022-07-01 19:33:51 +10:00
Peter Barker bc12a61c9a autotest: use slightly faster recv_msg call in drain_mav
Cuts out some code in pymavlink's recv_match which we don't need here.  We even explicitly don't run the idle hooks which pymavlink supplied when we're running under drain_mav
2022-06-30 09:46:13 +10:00
Peter Barker 208554d402 autotest: correct diagnostic message 2022-06-29 21:03:42 +10:00
Peter Barker f6816f38dc autotest: add timeout in drain_mav
At large speedups we can create more telemetry than we can consume.  Detect that and raise an exception, assuming we should be able to drain anything within 2 minutes
2022-06-29 21:03:42 +10:00