From 3e8b81e735cdb44322601ebe503bbd44aa06a3b1 Mon Sep 17 00:00:00 2001 From: Tedd Ho-Jeong An Date: Tue, 10 Mar 2020 10:00:58 -0700 Subject: [PATCH 1/2] workflow: Add workflow files This patch adds workflow files for ci: [sync.yml] - runs every 30 mins. - sync repo with upstream repo and rebase workflow branch to tip of master. - creates PR after reading patches from patchwork.kernel.org [ci.yml] - Tests the following checks: - checkpatch - gitlint - make - make check [code_scan.yml] - Static code checker: Coverity and Clang - Coverity: Submit the result to the coverity website - Clang Code Scan: Send email with result file to the internal team To simplify the history, new change will amend to this patch without creating new patch. --- .github/workflows/ci.yml | 25 +++++++++++++++++++ .github/workflows/code_scan.yml | 26 ++++++++++++++++++++ .github/workflows/sync.yml | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/code_scan.yml create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..a3a54d1a1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: [pull_request] + +jobs: + ci: + runs-on: ubuntu-latest + name: CI for Pull Request + steps: + - name: Checkout the source code + uses: actions/checkout@v3 + with: + path: src/src + + - name: CI + uses: tedd-an/bzcafe@main + with: + task: ci + base_folder: src + space: user + github_token: ${{ secrets.ACTION_TOKEN }} + email_token: ${{ secrets.EMAIL_TOKEN }} + patchwork_token: ${{ secrets.PATCHWORK_TOKEN }} + patchwork_user: ${{ secrets.PATCHWORK_USER }} + diff --git a/.github/workflows/code_scan.yml b/.github/workflows/code_scan.yml new file mode 100644 index 0000000000..181d08c32d --- /dev/null +++ b/.github/workflows/code_scan.yml @@ -0,0 +1,26 @@ +name: Code Scan + +on: + schedule: + - cron: "40 7 * * FRI" + +jobs: + code-scan: + runs-on: ubuntu-latest + steps: + - name: Checkout the source + uses: actions/checkout@v2 + with: + fetch-depth: 0 + path: src + - name: Code Scan + uses: BluezTestBot/action-code-scan@main + with: + src_path: src + github_token: ${{ secrets.GITHUB_TOKEN }} + email_token: ${{ secrets.EMAIL_TOKEN }} + - uses: actions/upload-artifact@v2 + with: + name: scan_report + path: scan_report.tar.gz + diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000000..d935cca9fa --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,43 @@ +name: Sync + +on: + schedule: + - cron: "*/30 * * * *" + +jobs: + sync_repo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: master + + - name: Sync Repo + uses: tedd-an/bzcafe@main + with: + task: sync + upstream_repo: 'https://git.kernel.org/pub/scm/bluetooth/bluez.git' + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Cleanup PR + uses: tedd-an/bzcafe@main + with: + task: cleanup + github_token: ${{ secrets.ACTION_TOKEN }} + + sync_patchwork: + needs: sync_repo + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Sync Patchwork + uses: tedd-an/bzcafe@main + with: + task: patchwork + space: user + github_token: ${{ secrets.ACTION_TOKEN }} + email_token: ${{ secrets.EMAIL_TOKEN }} + patchwork_token: ${{ secrets.PATCHWORK_TOKEN }} + patchwork_user: ${{ secrets.PATCHWORK_USER }} + From b4fda5023855ce63486796ced772773a6e85adfe Mon Sep 17 00:00:00 2001 From: Amisha Jain Date: Thu, 20 Mar 2025 14:13:56 +0530 Subject: [PATCH 2/2] obex: Add base implementation for get_mas_instance info and set notification filter This change is required for passing below testcases- 1. MAP/MSE/MMI/BV-02-C Verify that the MCE can return user-readable information about the MAS-instance to the MCE 2. MAP/MSE/MMN/BV-06-C Verify that the MSE correctly responds to a request to filter notifications. We are adding the raw skeleton implementaton for PTS certification. Although the functionality can be added later as per requirement. --- obexd/plugins/mas.c | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/obexd/plugins/mas.c b/obexd/plugins/mas.c index bf8d689adc..6076ad44c8 100644 --- a/obexd/plugins/mas.c +++ b/obexd/plugins/mas.c @@ -782,6 +782,36 @@ static void *notification_registration_open(const char *name, int oflag, return mas; } +static void *message_get_instance_open(const char *name, int oflag, + mode_t mode, void *driver_data, + size_t *size, int *err) +{ + struct mas_session *mas = driver_data; + + DBG(""); + + mas->buffer = g_string_new("Mas Instance 0"); + mas->finished = TRUE; + *err = 0; + + return mas; +} + +static void *message_notification_filter_open(const char *name, int oflag, + mode_t mode, void *driver_data, + size_t *size, int *err) +{ + struct mas_session *mas = driver_data; + + DBG(""); + + //TODO notifcation filter add + mas->finished = TRUE; + *err = 0; + + return mas; +} + static const struct obex_service_driver mas = { .name = "Message Access server", .service = OBEX_MAS, @@ -866,6 +896,26 @@ static const struct obex_mime_type_driver mime_message_update = { .write = any_write, }; +static struct obex_mime_type_driver mime_message_instance = { + .target = MAS_TARGET, + .target_size = TARGET_SIZE, + .mimetype = "x-bt/MASInstanceInformation", + .open = message_get_instance_open, + .close = any_close, + .read = any_read, + .write = any_write, +}; + +static struct obex_mime_type_driver mime_message_notification_filter = { + .target = MAS_TARGET, + .target_size = TARGET_SIZE, + .mimetype = "x-bt/MAP-notification-filter", + .open = message_notification_filter_open, + .close = any_close, + .read = any_read, + .write = any_write, +}; + static const struct obex_mime_type_driver *map_drivers[] = { &mime_map, &mime_message, @@ -874,6 +924,8 @@ static const struct obex_mime_type_driver *map_drivers[] = { &mime_notification_registration, &mime_message_status, &mime_message_update, + &mime_message_instance, + &mime_message_notification_filter, NULL };