On Wed, 30 Apr 2014 13:37:10 +0200
Petr Vobornik <pvobo...@redhat.com> wrote:

> On 29.4.2014 16:30, Misnyovszki Adam wrote:
> > On Fri, 25 Apr 2014 17:16:48 +0200
> > Misnyovszki Adam <amisn...@redhat.com> wrote:
> >
> >> Hi,
> >> this patch adds some static test data for the webui otptoken part.
> >> Adam
> >
> > Attached corrected DN's.
> > Thanks
> > Adam
> >
> 
> 1) Why otptoken_batch_del.json ends with error?  Also there might be
> a defect in UI that for batch delete operation it asks for batch.json
> and not $ENTITY_batch_del.json making otptoken_batch_del.json unused
> - out of scope of this patch.
> 
> 2) Why otptoken_mod.json ends with error?
> 
> 3) otptoken_find.json is not needed since the search facet uses
> paging (combination of otptoken_get_records.json and
> otptoken_find_pkeys.json is enough).
> 
> In general, it's OK to fake the data if there is some bug which
> causes errors and we know that it will be fixed.

Hi,
see the attached, and corrected 18 patch for otptoken static test data.
Also, I've added patch 20, for fixing the batch_del command in static
webui tests.

Thanks
Adam
>From 22577cf672128231cb4b2ced7e7ee1c12da664c7 Mon Sep 17 00:00:00 2001
From: Adam Misnyovszki <amisn...@redhat.com>
Date: Wed, 30 Apr 2014 17:53:52 +0200
Subject: [PATCH 1/2] webui OTP token test data added

---
 install/ui/test/data/otptoken_add.json         | 43 +++++++++++++++
 install/ui/test/data/otptoken_batch.json       | 27 ++++++++++
 install/ui/test/data/otptoken_batch_del.json   | 27 ++++++++++
 install/ui/test/data/otptoken_batch_mod.json   | 34 ++++++++++++
 install/ui/test/data/otptoken_find_pkeys.json  | 17 ++++++
 install/ui/test/data/otptoken_get_records.json | 57 ++++++++++++++++++++
 install/ui/test/data/otptoken_mod.json         | 72 ++++++++++++++++++++++++++
 install/ui/test/data/otptoken_show.json        | 51 ++++++++++++++++++
 8 files changed, 328 insertions(+)
 create mode 100644 install/ui/test/data/otptoken_add.json
 create mode 100644 install/ui/test/data/otptoken_batch.json
 create mode 100644 install/ui/test/data/otptoken_batch_del.json
 create mode 100644 install/ui/test/data/otptoken_batch_mod.json
 create mode 100644 install/ui/test/data/otptoken_find_pkeys.json
 create mode 100644 install/ui/test/data/otptoken_get_records.json
 create mode 100644 install/ui/test/data/otptoken_mod.json
 create mode 100644 install/ui/test/data/otptoken_show.json

diff --git a/install/ui/test/data/otptoken_add.json b/install/ui/test/data/otptoken_add.json
new file mode 100644
index 0000000000000000000000000000000000000000..c52fc15035e0aad025294a8da1f938ee53c8e5a9
--- /dev/null
+++ b/install/ui/test/data/otptoken_add.json
@@ -0,0 +1,43 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "result": {
+            "dn": "ipatokenuniqueid=10bd43b5-3204-4695-9225-91064f6c77b3,cn=otp,dc=example,dc=com",
+            "ipatokenmodel": [
+                "totp"
+            ],
+            "ipatokenotpalgorithm": [
+                "sha1"
+            ],
+            "ipatokenotpdigits": [
+                "6"
+            ],
+            "ipatokenotpkey": [
+                {
+                    "__base64__": "2TUYXOVTaZf/Og=="
+                }
+            ],
+            "ipatokentotpclockoffset": [
+                "0"
+            ],
+            "ipatokentotptimestep": [
+                "30"
+            ],
+            "ipatokenuniqueid": [
+                "footoken"
+            ],
+            "ipatokenvendor": [
+                "FreeIPA"
+            ],
+            "objectclass": [
+                "top",
+                "ipatokentotp",
+                "ipatoken"
+            ],
+            "uri": "otpauth://totp/EXAMPLE.COM:10bd43b5-3204-4695-9225-91064f6c77b3?digits=6&secret=3E2RQXHFKNUZP7Z2&period=30&algorithm=sha1&issuer=EXAMPLE.COM"
+        },
+        "summary": "Added OTP token \"10bd43b5-3204-4695-9225-91064f6c77b3\"",
+        "value": "10bd43b5-3204-4695-9225-91064f6c77b3"
+    }
+}
diff --git a/install/ui/test/data/otptoken_batch.json b/install/ui/test/data/otptoken_batch.json
new file mode 100644
index 0000000000000000000000000000000000000000..059b53f96ebe34036394b969f12903e8b52d69fa
--- /dev/null
+++ b/install/ui/test/data/otptoken_batch.json
@@ -0,0 +1,27 @@
+{
+    "error": null, 
+    "id": null, 
+    "result": {
+        "count": 1, 
+        "messages": [
+            {
+                "code": 13001, 
+                "message": "API Version number was not sent, forward compatibility not guaranteed. Assuming server's API version, 2.83", 
+                "name": "VersionMissing", 
+                "type": "warning"
+            }
+        ], 
+        "results": [
+            {
+                "error": null, 
+                "result": {
+                    "failed": []
+                }, 
+                "summary": "Deleted OTP token \"10bd43b5-3204-4695-9225-91064f6c77b3\"", 
+                "value": [
+                    "10bd43b5-3204-4695-9225-91064f6c77b3"
+                ]
+            }
+        ]
+    }, 
+}
diff --git a/install/ui/test/data/otptoken_batch_del.json b/install/ui/test/data/otptoken_batch_del.json
new file mode 100644
index 0000000000000000000000000000000000000000..7dca290b8bb5c0e2f19f37fac14177df67ebce5a
--- /dev/null
+++ b/install/ui/test/data/otptoken_batch_del.json
@@ -0,0 +1,27 @@
+{
+    "error": null, 
+    "id": null, 
+    "result": {
+        "count": 1, 
+        "messages": [
+            {
+                "code": 13001, 
+                "message": "API Version number was not sent, forward compatibility not guaranteed. Assuming server's API version, 2.83", 
+                "name": "VersionMissing", 
+                "type": "warning"
+            }
+        ], 
+        "results": [
+            {
+                "error": null, 
+                "result": {
+                    "failed": []
+                }, 
+                "summary": "Deleted OTP token \"10bd43b5-3204-4695-9225-91064f6c77b3\"", 
+                "value": [
+                    "10bd43b5-3204-4695-9225-91064f6c77b3"
+                ]
+            }
+        ]
+    }
+}
diff --git a/install/ui/test/data/otptoken_batch_mod.json b/install/ui/test/data/otptoken_batch_mod.json
new file mode 100644
index 0000000000000000000000000000000000000000..63b99b684ee2ee8aaede06f4f5f6d8080c71fe8c
--- /dev/null
+++ b/install/ui/test/data/otptoken_batch_mod.json
@@ -0,0 +1,34 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "count": 1,
+        "results": [
+            {
+                "error": null,
+                "result": {
+                    "description": [
+                        "Description"
+                    ],
+                    "ipatokendisabled": [
+                        "FALSE"
+                    ],
+                    "ipatokenmodel": [
+                        "totp"
+                    ],
+                    "ipatokenowner": [
+                        "admin"
+                    ],
+                    "ipatokenuniqueid": [
+                        "10bd43b5-3204-4695-9225-91064f6c77b3"
+                    ],
+                    "ipatokenvendor": [
+                        "FreeIPA"
+                    ]
+                },
+                "summary": "Modified OTP token \"10bd43b5-3204-4695-9225-91064f6c77b3\"",
+                "value": "10bd43b5-3204-4695-9225-91064f6c77b3"
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/install/ui/test/data/otptoken_find_pkeys.json b/install/ui/test/data/otptoken_find_pkeys.json
new file mode 100644
index 0000000000000000000000000000000000000000..5b7d788a1aa41401e4a1bfb74fa784eef232e7e5
--- /dev/null
+++ b/install/ui/test/data/otptoken_find_pkeys.json
@@ -0,0 +1,17 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "count": 1,
+        "result": [
+            {
+                "dn": "ipatokenuniqueid=10bd43b5-3204-4695-9225-91064f6c77b3,cn=otp,dc=example,dc=com",
+                "ipatokenuniqueid": [
+                    "10bd43b5-3204-4695-9225-91064f6c77b3"
+                ]
+            }
+        ],
+        "summary": "1 OTP token matched",
+        "truncated": false
+    }
+}
\ No newline at end of file
diff --git a/install/ui/test/data/otptoken_get_records.json b/install/ui/test/data/otptoken_get_records.json
new file mode 100644
index 0000000000000000000000000000000000000000..b3e746db5a346cc9b3bece805572cd77fc3472ef
--- /dev/null
+++ b/install/ui/test/data/otptoken_get_records.json
@@ -0,0 +1,57 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "count": 1,
+        "results": [
+            {
+                "error": null,
+                "result": {
+                    "description": [
+                        "Description"
+                    ],
+                    "dn": "ipatokenuniqueid=10bd43b5-3204-4695-9225-91064f6c77b3,cn=otp,dc=example,dc=com",
+                    "ipatokendisabled": [
+                        "TRUE"
+                    ],
+                    "ipatokenmodel": [
+                        "totp"
+                    ],
+                    "ipatokenotpalgorithm": [
+                        "sha1"
+                    ],
+                    "ipatokenotpdigits": [
+                        "6"
+                    ],
+                    "ipatokenotpkey": [
+                        {
+                            "__base64__": "++R6gVcVPHzz3Q=="
+                        }
+                    ],
+                    "ipatokenowner": [
+                        "admin"
+                    ],
+                    "ipatokentotpclockoffset": [
+                        "0"
+                    ],
+                    "ipatokentotptimestep": [
+                        "30"
+                    ],
+                    "ipatokenuniqueid": [
+                        "10bd43b5-3204-4695-9225-91064f6c77b3"
+                    ],
+                    "ipatokenvendor": [
+                        "FreeIPA"
+                    ],
+                    "objectclass": [
+                        "top",
+                        "ipatokentotp",
+                        "ipatoken"
+                    ]
+                },
+                "summary": null,
+                "value": "10bd43b5-3204-4695-9225-91064f6c77b3"
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/install/ui/test/data/otptoken_mod.json b/install/ui/test/data/otptoken_mod.json
new file mode 100644
index 0000000000000000000000000000000000000000..359c4dd2f0e0ffb25e64fa2a92caaa91a4d8e3a1
--- /dev/null
+++ b/install/ui/test/data/otptoken_mod.json
@@ -0,0 +1,72 @@
+{
+    "error": null, 
+    "id": null, 
+    "result": {
+        "messages": [
+            {
+                "code": 13001, 
+                "message": "API Version number was not sent, forward compatibility not guaranteed. Assuming server's API version, 2.83", 
+                "name": "VersionMissing", 
+                "type": "warning"
+            }
+        ], 
+        "result": {
+            "attributelevelrights": {
+                "aci": "rscwo", 
+                "description": "rscwo", 
+                "ipatokendisabled": "rscwo", 
+                "ipatokenmodel": "rscwo", 
+                "ipatokennotafter": "rscwo", 
+                "ipatokennotbefore": "rscwo", 
+                "ipatokenotpalgorithm": "rscwo", 
+                "ipatokenotpdigits": "rscwo", 
+                "ipatokenotpkey": "rscwo", 
+                "ipatokenowner": "rscwo", 
+                "ipatokenserial": "rscwo", 
+                "ipatokentotpclockoffset": "rscwo", 
+                "ipatokentotptimestep": "rscwo", 
+                "ipatokenuniqueid": "rscwo", 
+                "ipatokenvendor": "rscwo", 
+                "nsaccountlock": "rscwo", 
+                "objectclass": "rscwo"
+            }, 
+            "description": [
+                "a"
+            ], 
+            "dn": "ipatokenuniqueid=10bd43b5-3204-4695-9225-91064f6c77b3,cn=otp,dc=example,dc=com",
+            "ipatokenmodel": [
+                "totp"
+            ], 
+            "ipatokenotpalgorithm": [
+                "sha1"
+            ], 
+            "ipatokenotpdigits": [
+                "6"
+            ], 
+            "ipatokenotpkey": [
+                {
+                    "__base64__": "zxQLlzbl+khKOw=="
+                }
+            ], 
+            "ipatokentotpclockoffset": [
+                "0"
+            ], 
+            "ipatokentotptimestep": [
+                "30"
+            ], 
+            "ipatokenuniqueid": [
+                "10bd43b5-3204-4695-9225-91064f6c77b3"
+            ], 
+            "ipatokenvendor": [
+                "FreeIPA"
+            ], 
+            "objectclass": [
+                "top", 
+                "ipatokentotp", 
+                "ipatoken"
+            ]
+        }, 
+        "summary": "Modified OTP token \"10bd43b5-3204-4695-9225-91064f6c77b3\"", 
+        "value": "10bd43b5-3204-4695-9225-91064f6c77b3"
+    }
+}
diff --git a/install/ui/test/data/otptoken_show.json b/install/ui/test/data/otptoken_show.json
new file mode 100644
index 0000000000000000000000000000000000000000..96c149d9dcc1fb1592d55ca7ca63b93d8fec9c18
--- /dev/null
+++ b/install/ui/test/data/otptoken_show.json
@@ -0,0 +1,51 @@
+{
+    "error": null,
+    "id": null,
+    "result": {
+        "result": {
+            "description": [
+                "Description"
+            ],
+            "dn": "ipatokenuniqueid=10bd43b5-3204-4695-9225-91064f6c77b3,cn=otp,dc=example,dc=com",
+            "ipatokendisabled": [
+                "TRUE"
+            ],
+            "ipatokenmodel": [
+                "totp"
+            ],
+            "ipatokenotpalgorithm": [
+                "sha1"
+            ],
+            "ipatokenotpdigits": [
+                "6"
+            ],
+            "ipatokenotpkey": [
+                {
+                    "__base64__": "++R6gVcVPHzz3Q=="
+                }
+            ],
+            "ipatokenowner": [
+                "admin"
+            ],
+            "ipatokentotpclockoffset": [
+                "0"
+            ],
+            "ipatokentotptimestep": [
+                "30"
+            ],
+            "ipatokenuniqueid": [
+                "10bd43b5-3204-4695-9225-91064f6c77b3"
+            ],
+            "ipatokenvendor": [
+                "FreeIPA"
+            ],
+            "objectclass": [
+                "top",
+                "ipatokentotp",
+                "ipatoken"
+            ]
+        },
+        "summary": null,
+        "value": "10bd43b5-3204-4695-9225-91064f6c77b3"
+    }
+}
\ No newline at end of file
-- 
1.9.0

>From 2b69e57f893f68efa1dc89507430881cb4b033f0 Mon Sep 17 00:00:00 2001
From: Adam Misnyovszki <amisn...@redhat.com>
Date: Mon, 5 May 2014 16:31:55 +0200
Subject: [PATCH] webui static site delete command fixed

When the static test site called batch delete,
it always referred to batch.json. This patch
fixes it, by referring entityname + '_batch_del.json'
---
 install/ui/src/freeipa/search.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js
index 8701c33c3b3752cdeddffebe3cb325d26ad81dee..dc7bfcf42e76c669bb4668d49f41440deae933f9 100644
--- a/install/ui/src/freeipa/search.js
+++ b/install/ui/src/freeipa/search.js
@@ -314,7 +314,8 @@ IPA.search_deleter_dialog = function(spec) {
 
     that.create_command = function() {
         var batch = rpc.batch_command({
-            error_message: '@i18n:search.partial_delete'
+            error_message: '@i18n:search.partial_delete',
+            name: that.entity.name + '_batch_del'
         });
 
         for (var i=0; i<that.values.length; i++) {
-- 
1.9.0

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to