From 1030b825c1fa265f77a09ce87c671616f79b7ab6 Mon Sep 17 00:00:00 2001
From: Mike McLean <mikem@redhat.com>
Date: Oct 23 2023 20:09:37 +0000
Subject: [PATCH 1/2] also include renew time


---

diff --git a/kojihub/kojihub.py b/kojihub/kojihub.py
index a99e225..258c480 100644
--- a/kojihub/kojihub.py
+++ b/kojihub/kojihub.py
@@ -10381,6 +10381,8 @@ class RootExports(object):
             ("date_part('epoch', start_time)", 'start_ts'),
             ('update_time', 'update_time'),
             ("date_part('epoch', update_time)", 'update_ts'),
+            ('renew_time', 'renew_time'),
+            ("date_part('epoch', renew_time)", 'renew_ts'),
             ('exclusive', 'exclusive'),
         ]
         columns, aliases = zip(*fields)

From a128ee12e73fb37b9c31fbfc4b0734d1511f846c Mon Sep 17 00:00:00 2001
From: Mike McLean <mikem@redhat.com>
Date: Oct 26 2023 20:54:32 +0000
Subject: [PATCH 2/2] unit test fixes


---

diff --git a/tests/test_hub/test_get_session_info.py b/tests/test_hub/test_get_session_info.py
index d772326..15d09d6 100644
--- a/tests/test_hub/test_get_session_info.py
+++ b/tests/test_hub/test_get_session_info.py
@@ -41,10 +41,12 @@ class TestGetSessionInfo(DBQueryTestCase):
         self.assertEqual(query.clauses, ['expired is FALSE', 'user_id = %(user_id)i'])
         self.assertEqual(query.joins, None)
         self.assertEqual(query.columns, ['authtype', 'callnum', 'exclusive', 'expired', 'master',
+                                         'renew_time', "date_part('epoch', renew_time)",
                                          'start_time', "date_part('epoch', start_time)",
                                          'update_time', "date_part('epoch', update_time)",
                                          'user_id'])
         self.assertEqual(query.aliases, ['authtype', 'callnum', 'exclusive', 'expired', 'master',
+                                         'renew_time', 'renew_ts',
                                          'start_time', 'start_ts', 'update_time', 'update_ts',
                                          'user_id'])
 
@@ -58,12 +60,14 @@ class TestGetSessionInfo(DBQueryTestCase):
         self.assertEqual(query.clauses, ['expired is FALSE', 'user_id = %(user_id)i'])
         self.assertEqual(query.joins, None)
         self.assertEqual(query.columns, ['authtype', 'callnum', 'exclusive', 'expired', 'hostip',
-                                         'id', 'master', 'start_time',
-                                         "date_part('epoch', start_time)",
+                                         'id', 'master',
+                                         'renew_time', "date_part('epoch', renew_time)",
+                                         'start_time', "date_part('epoch', start_time)",
                                          'update_time', "date_part('epoch', update_time)",
                                          'user_id'])
         self.assertEqual(query.aliases, ['authtype', 'callnum', 'exclusive', 'expired', 'hostip',
-                                         'id', 'master', 'start_time', 'start_ts', 'update_time',
+                                         'id', 'master', 'renew_time', 'renew_ts',
+                                         'start_time', 'start_ts', 'update_time',
                                          'update_ts', 'user_id'])
 
     def test_get_session_info_user(self):
@@ -76,10 +80,12 @@ class TestGetSessionInfo(DBQueryTestCase):
         self.assertEqual(query.clauses, ['expired is FALSE', 'user_id = %(user_id)i'])
         self.assertEqual(query.joins, None)
         self.assertEqual(query.columns, ['authtype', 'callnum', 'exclusive', 'expired', 'master',
+                                         'renew_time', "date_part('epoch', renew_time)",
                                          'start_time', "date_part('epoch', start_time)",
                                          'update_time', "date_part('epoch', update_time)",
                                          'user_id'])
         self.assertEqual(query.aliases, ['authtype', 'callnum', 'exclusive', 'expired', 'master',
+                                         'renew_time', 'renew_ts',
                                          'start_time', 'start_ts', 'update_time', 'update_ts',
                                          'user_id'])
 
@@ -94,9 +100,12 @@ class TestGetSessionInfo(DBQueryTestCase):
         self.assertEqual(query.clauses, ['expired is FALSE', 'id = %(id)i'])
         self.assertEqual(query.joins, None)
         self.assertEqual(query.columns, ['authtype', 'callnum', 'exclusive', 'expired', 'hostip',
-                                         'id', 'master', 'start_time',
-                                         "date_part('epoch', start_time)", 'update_time',
-                                         "date_part('epoch', update_time)", 'user_id'])
+                                         'id', 'master',
+                                         'renew_time', "date_part('epoch', renew_time)",
+                                         'start_time', "date_part('epoch', start_time)",
+                                         'update_time', "date_part('epoch', update_time)",
+                                         'user_id'])
         self.assertEqual(query.aliases, ['authtype', 'callnum', 'exclusive', 'expired', 'hostip',
-                                         'id', 'master', 'start_time', 'start_ts', 'update_time',
+                                         'id', 'master', 'renew_time', 'renew_ts',
+                                         'start_time', 'start_ts', 'update_time',
                                          'update_ts', 'user_id'])

